@import "highlight.js/styles/github.css" (prefers-color-scheme: light);
@import "highlight.js/styles/github-dark.css" (prefers-color-scheme: dark);

:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-subtle: #f0f3f7;
  --surface: #ffffff;
  --surface-raised: #f0f3f7;
  --text: #172033;
  --muted: #667085;
  --text-muted: #667085;
  --border: #d9dee8;
  --accent: #0f766e;
  --accent-soft: #d9f4f0;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* JSON Canvas editor ---------------------------------------------------- */
.canvas-editor {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--panel, #fff);
  color: var(--text, #18202b);
}
.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 43px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border, #d7dde5);
  background: var(--panel, #fff);
  z-index: 20;
}
.canvas-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 32px;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
}
.canvas-toolbar button:hover:not(:disabled),
.canvas-mode-tabs button.active {
  background: color-mix(in srgb, var(--accent, #2878d0) 14%, transparent);
  color: var(--accent, #1769aa);
}
.canvas-toolbar button:disabled {
  opacity: .35;
  cursor: default;
}
.canvas-mode-tabs {
  display: flex;
  border: 1px solid var(--border, #d7dde5);
  border-radius: 7px;
  overflow: hidden;
}
.canvas-mode-tabs button {
  border-radius: 0;
  min-width: auto;
}
.canvas-mode-tabs button + button {
  border-left: 1px solid var(--border, #d7dde5);
}
.canvas-toolbar-separator {
  width: 1px;
  height: 24px;
  margin: 0 3px;
  background: var(--border, #d7dde5);
}
.canvas-toolbar-spacer {
  flex: 1;
}
.canvas-zoom-label {
  min-width: 42px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #64748b);
}
.canvas-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  outline: none;
  cursor: grab;
  background-color: var(--canvas-bg, #f4f6f8);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text,
    #334155) 20%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
}
.canvas-viewport:active {
  cursor: grabbing;
}
.canvas-world {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
}
.canvas-edges {
  position: absolute;
  left: -100000px;
  top: -100000px;
  width: 200000px;
  height: 200000px;
  overflow: visible;
  pointer-events: none;
}
.canvas-edge {
  pointer-events: stroke;
  cursor: pointer;
}
.canvas-edge-line {
  fill: none;
  stroke-width: 3;
}
.canvas-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
}
.canvas-edge.selected .canvas-edge-line {
  stroke-width: 5;
  filter: drop-shadow(0 0 2px var(--accent, #2878d0));
}
.canvas-edge text {
  fill: var(--text, #334155);
  font: 13px sans-serif;
  paint-order: stroke;
  stroke: var(--canvas-bg, #f4f6f8);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.canvas-edge marker path {
  fill: context-stroke;
}
.canvas-node {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--canvas-accent) 55%, #cbd5e1);
  border-radius: 9px;
  background: var(--panel, #fff);
  box-shadow: 0 2px 9px rgb(15 23 42 / .1);
  overflow: visible;
  cursor: default;
}
.canvas-node:not(.canvas-node-group) {
  overflow: hidden;
}
.canvas-node.selected {
  overflow: visible;
  border-color: var(--canvas-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--canvas-accent) 25%,
    transparent), 0 5px 18px rgb(15 23 42 / .16);
}
.is-editing .canvas-node {
  cursor: move;
}
.canvas-node-accent {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--canvas-accent);
  pointer-events: none;
}
.canvas-node-group {
  background: color-mix(in srgb, var(--canvas-accent) 5%, transparent);
  border-width: 2px;
  box-shadow: none;
}
.canvas-node-group .canvas-node-accent {
  inset: 0 0 auto;
  width: auto;
  height: 4px;
  border-radius: 7px 7px 0 0;
}
.canvas-group-label {
  position: absolute;
  left: 10px;
  top: 8px;
  z-index: 2;
  max-width: calc(100% - 20px);
  border: 0;
  background: color-mix(in srgb, var(--panel, #fff) 82%, transparent);
  color: inherit;
  padding: 3px 7px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 14px;
}
input.canvas-group-label {
  outline: 1px solid color-mix(in srgb, var(--canvas-accent) 30%, transparent);
}
.canvas-text-editor {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 15px 17px 15px 19px;
  background: transparent;
  color: inherit;
  font: 14px/1.55 inherit;
  cursor: text;
}
.canvas-markdown {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 9px 15px 12px 19px;
  font-size: 14px;
}
.canvas-markdown > :first-child,
.canvas-card-preview > :first-child {
  margin-top: 0;
}
.canvas-file-preview,
.canvas-link-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.canvas-card-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid var(--border, #d7dde5);
  font-size: 13px;
  font-weight: 650;
}
.canvas-card-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-card-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 9px 12px 11px 15px;
  font-size: 12px;
}
.canvas-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.canvas-card-preview pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 ui-monospace, monospace;
}
.canvas-card-preview .markdown-preview {
  font-size: 12px;
}
.canvas-link-host {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 15px;
  color: var(--accent, #1769aa);
  overflow-wrap: anywhere;
  text-align: center;
}
.canvas-link-card iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
  pointer-events: none;
}
.canvas-muted {
  color: var(--muted, #64748b);
}
.canvas-error {
  color: #dc2626;
}
.canvas-node-actions {
  position: absolute;
  z-index: 10;
  right: 7px;
  top: 7px;
  display: flex;
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--border, #d7dde5);
  border-radius: 6px;
  background: var(--panel, #fff);
  box-shadow: 0 2px 8px rgb(15 23 42 / .15);
}
.canvas-node-actions button,
.canvas-connect,
.canvas-resize {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.canvas-node-actions button {
  width: 25px;
  height: 25px;
  border-radius: 4px;
}
.canvas-node-actions button:hover {
  background: color-mix(in srgb, var(--accent, #2878d0) 13%, transparent);
}
.canvas-connect {
  position: absolute;
  z-index: 11;
  width: 17px;
  height: 17px;
  border: 2px solid var(--panel, #fff);
  border-radius: 50%;
  background: var(--canvas-accent);
  color: white;
  padding: 0;
  box-shadow: 0 1px 4px rgb(15 23 42 / .25);
}
.canvas-connect svg {
  display: none;
}
.canvas-connect:hover,
.canvas-connect.active {
  transform: scale(1.35);
}
.canvas-connect-top {
  left: 50%;
  top: -9px;
  margin-left: -8px;
}
.canvas-connect-right {
  right: -9px;
  top: 50%;
  margin-top: -8px;
}
.canvas-connect-bottom {
  left: 50%;
  bottom: -9px;
  margin-left: -8px;
}
.canvas-connect-left {
  left: -9px;
  top: 50%;
  margin-top: -8px;
}
.canvas-resize {
  position: absolute;
  z-index: 12;
  right: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--canvas-accent);
  color: #fff;
  cursor: nwse-resize;
}
.canvas-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  color: var(--muted, #64748b);
  text-align: center;
}
.canvas-empty strong {
  color: var(--text, #334155);
  font-size: 16px;
}
.canvas-empty button,
.canvas-error-banner button {
  border: 1px solid var(--border, #d7dde5);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 6px 10px;
  cursor: pointer;
}
.canvas-connect-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border-radius: 7px;
  background: rgb(15 23 42 / .88);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}
.canvas-properties {
  position: absolute;
  z-index: 15;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(250px, calc(100% - 24px));
  padding: 11px;
  border: 1px solid var(--border, #d7dde5);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel, #fff) 96%, transparent);
  box-shadow: 0 8px 25px rgb(15 23 42 / .18);
  font-size: 13px;
}
.canvas-properties > strong {
  font-size: 14px;
}
.canvas-properties > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted, #64748b);
}
.canvas-properties input[type="text"],
.canvas-properties label > input:not([type]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border, #d7dde5);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
  padding: 5px 7px;
  font-size: 13px;
}
.canvas-property-checks {
  display: flex;
  gap: 10px;
}
.canvas-property-checks label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.canvas-color-row {
  display: flex;
  gap: 7px;
}
.canvas-color-row button {
  width: 20px;
  height: 20px;
  border: 2px solid var(--panel, #fff);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border, #d7dde5);
  cursor: pointer;
}
.canvas-color-row button.active {
  box-shadow: 0 0 0 2px var(--text, #172033);
}
.canvas-error-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}
.canvas-parse-error {
  overflow: hidden;
  color: #dc2626;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.canvas-raw {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
}
.dark .canvas-editor,
[data-theme="dark"] .canvas-editor {
  --canvas-bg: #10151d;
}

:root.dark {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171c22;
  --panel-subtle: #202832;
  --surface: #171c22;
  --surface-raised: #202832;
  --text: #e8edf3;
  --muted: #99a5b3;
  --text-muted: #99a5b3;
  --border: #303a46;
  --accent: #5eead4;
  --accent-soft: #123833;
  --danger: #f97066;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  height: 100%;
  min-width: 320px;
}

.ide-frame {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.editor-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.side-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
  padding-top: 6px;
}

.side-rail.left {
  border-right: 1px solid var(--border);
}
.side-rail.right {
  border-left: 1px solid var(--border);
}

.side-rail button {
  display: inline-flex;
  width: 28px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.side-rail button:hover {
  background: var(--panel-subtle);
  color: var(--accent);
}

.side-rail span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.pane-resizer {
  position: relative;
  z-index: 50;
  width: 5px;
  min-height: 0;
  cursor: col-resize;
  touch-action: none;
}

.pane-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--border);
  content: "";
  transition: background 120ms ease, width 120ms ease, left 120ms ease;
}

.pane-resizer:hover::after,
.resizing-side-pane .pane-resizer::after {
  left: 1px;
  width: 3px;
  background: var(--accent);
}

body.resizing-side-pane,
body.resizing-side-pane * {
  cursor: col-resize !important;
  user-select: none !important;
}

.file-tree-panel,
.plugin-host {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
}

.plugin-host {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  border-right: 0;
  border-left: 1px solid var(--border);
}

.plugin-host-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  padding: 5px 7px;
}

.plugin-host-tabs > span {
  flex: 1;
}

.plugin-host-tabs button,
.plugin-manager header button {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.plugin-host-tabs button:hover,
.plugin-host-tabs button.active,
.plugin-manager header button:hover {
  background: var(--panel-subtle);
  color: var(--accent);
}

.plugin-host-body {
  min-height: 0;
  overflow: auto;
}

.plugin-sidebar-view {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.plugin-sidebar-view > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 7px;
}

.plugin-sidebar-view select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 8px;
}

.plugin-sidebar-view > header button {
  display: inline-flex;
  width: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.plugin-sidebar-view > header button:hover:not(:disabled) {
  color: var(--accent);
}
.plugin-sidebar-view > header button:disabled {
  cursor: default;
  opacity: 0.4;
}
.plugin-sidebar-view-body {
  min-height: 0;
  overflow: auto;
}

.chat-placeholder {
  display: flex;
  height: 100%;
  min-height: 200px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.chat-placeholder strong {
  color: var(--text);
}

.chat-placeholder span {
  font-size: 0.78rem;
}

.plugin-manager {
  padding: 12px;
}

.plugin-manager > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.plugin-manager > header > div {
  display: grid;
  gap: 2px;
}

.plugin-manager header small {
  color: var(--muted);
  font-size: 0.72rem;
}

.plugin-manager article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px;
}

.plugin-manager article > div,
.plugin-manager-open > span {
  display: grid;
  gap: 4px;
}

.plugin-manager-open {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.plugin-manager-open > span {
  min-width: 0;
}
.plugin-manager-open > svg {
  flex: none;
  color: var(--muted);
}
.plugin-manager-open:hover > svg {
  color: var(--accent);
}
.plugin-manager-open:disabled {
  cursor: default;
  opacity: 0.65;
}

.plugin-manager article small {
  color: var(--muted);
  font-size: 0.72rem;
}

.plugin-manager .plugin-recommendation {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
}

.plugin-manager .plugin-recommendation-official,
.plugin-manager .plugin-recommendation-custom {
  color: var(--accent);
}
.plugin-manager .plugin-recommendation-third-party {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  color: var(--danger);
}

.plugin-manager article em {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 0.72rem;
}

.plugin-manager article.plugin-manager-selected {
  border-color: var(--accent);
}
.plugin-manager-settings {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.plugin-install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-bottom: 10px;
}

.plugin-install input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 7px 8px;
}

.plugin-install button,
.plugin-manager-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
}

.plugin-install button:disabled,
.plugin-manager-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.plugin-manager-message {
  color: var(--muted);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}
.plugin-manager-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 5px;
}
.spin {
  animation: plugin-spin 0.8s linear infinite;
}
@keyframes plugin-spin {
  to {
    transform: rotate(360deg);
  }
}

.plugin-toggle {
  align-self: center;
}

.plugin-toggle input {
  accent-color: var(--accent);
}

.chat-panel {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
}

.chat-panel-header {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 6px 9px;
}

.chat-panel-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.chat-panel-header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel-header button,
.chat-clear {
  display: inline-flex;
  width: 29px;
  height: 29px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-panel-header button:hover,
.chat-clear:hover {
  background: var(--panel-subtle);
  color: var(--text);
}

.chat-session-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 6px 8px;
}

.chat-session-bar select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 7px;
  font-size: 0.72rem;
}

.chat-session-bar button {
  display: inline-flex;
  width: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.chat-session-bar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-session-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-settings {
  display: grid;
  max-height: 56vh;
  gap: 8px;
  overflow: auto;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 10px;
}

.chat-settings label:not(.chat-tool-toggle) {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-settings input,
.chat-settings select,
.chat-settings textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  padding: 6px 7px;
  font-size: 0.76rem;
  resize: vertical;
}

.chat-tool-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 0.72rem;
}

.chat-settings > small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.chat-welcome {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.chat-welcome strong {
  color: var(--text);
}

.chat-welcome span {
  max-width: 220px;
  font-size: 0.75rem;
  line-height: 1.45;
}

.chat-welcome-guides {
  display: grid;
  width: min(100%, 360px);
  gap: 8px;
  margin-top: 10px;
  text-align: left;
}

.chat-welcome-guides article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 10px;
}

.chat-welcome-guides article > div,
.chat-welcome-guides button {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-welcome-guides article > div {
  color: var(--text);
  font-size: 0.75rem;
}

.chat-welcome-guides p {
  margin: 6px 0 9px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.chat-welcome-guides button {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  font-size: 0.68rem;
  font-weight: 650;
}

.chat-welcome-guides button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-message {
  margin-bottom: 13px;
}

.chat-message > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-message.user {
  margin-left: 20px;
  border-radius: 9px;
  background: var(--accent-soft);
  padding: 8px 10px;
}

.chat-message.user p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.8rem;
  line-height: 1.5;
}

.chat-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.chat-message-attachments > span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 4px 7px;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-attachments small {
  color: var(--muted);
  font-size: 0.58rem;
}

.chat-message .markdown-preview {
  width: 100%;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.chat-message .markdown-preview > :first-child {
  margin-top: 0;
}
.chat-message .markdown-preview > :last-child {
  margin-bottom: 0;
}

.chat-response-thinking {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-subtle);
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-response-thinking summary {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 7px 9px;
  font-weight: 650;
  user-select: none;
}

.chat-response-thinking[open] summary {
  border-bottom: 1px solid var(--border);
}

.chat-response-thinking > div {
  max-height: 280px;
  overflow: auto;
  padding: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-response-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.chat-response-tools span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--panel-subtle);
  color: var(--muted);
  font-size: 0.65rem;
  padding: 3px 7px;
}

.chat-response-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.chat-response-sources span,
.chat-response-sources button,
.chat-response-sources a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-subtle));
  color: var(--accent);
  font: inherit;
  font-size: 0.65rem;
  padding: 3px 7px;
}

.chat-response-sources button,
.chat-response-sources a {
  max-width: 100%;
  cursor: pointer;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.chat-response-sources button:hover,
.chat-response-sources a:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-subtle));
}

.chat-web-sources {
  border-top: 0;
  margin-top: 5px;
  padding-top: 0;
}

.chat-response-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chat-response-usage span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chat-generated-images {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.chat-generated-images img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: 7px;
  object-fit: contain;
}
.chat-mcp-apps {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.chat-mcp-app {
  display: flex;
  min-height: 240px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-subtle);
}
.chat-mcp-app.expanded {
  position: fixed;
  z-index: 9000;
  inset: 7vh 8vw;
  min-height: 0;
  box-shadow: 0 22px 70px rgb(0 0 0 / 45%);
}
.chat-mcp-app header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 10px;
}
.chat-mcp-app header span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chat-mcp-app header button {
  display: grid;
  width: 24px;
  height: 22px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.chat-mcp-app iframe {
  flex: 1;
  width: 100%;
  min-height: 210px;
  border: 0;
  background: white;
}
.chat-open-failed-workflow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: 5px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
}

.chat-thinking {
  display: flex;
  gap: 4px;
  padding: 8px;
}

.chat-thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: chat-pulse 1s ease-in-out infinite;
  background: var(--muted);
}

.chat-thinking span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-thinking span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chat-pulse {
  50% {
    transform: translateY(-3px);
    opacity: 0.45;
  }
}

.pending-file-action-backdrop {
  position: fixed;
  z-index: 1250;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.5);
  padding: 18px;
}

.pending-file-action {
  display: grid;
  width: min(1024px, 100%);
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 80px rgb(0 0 0 / 0.32);
}

.pending-file-action.write {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(720px, 84vh);
}

.pending-file-action.rename {
  grid-template-rows: auto auto auto;
}

.pending-file-action > header,
.pending-file-action > footer,
.pending-file-action > header > div,
.pending-file-action-path,
.pending-file-action-diff-header,
.pending-file-action-diff-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-file-action > header,
.pending-file-action > footer {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 11px 13px;
}

.pending-file-action > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.pending-file-action code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.pending-file-action-path {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 9px 13px;
}

.pending-file-action-path > span {
  flex: none;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  font-size: 0.7rem;
}

.pending-file-action button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: var(--panel);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 0.72rem;
}

.pending-file-action button:disabled {
  cursor: default;
  opacity: 0.5;
}

.pending-file-action button.secondary {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.pending-file-action > header button.icon-button {
  width: 28px;
  height: 28px;
  justify-content: center;
  padding: 0;
}

.pending-file-action-diff {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.pending-file-action-diff-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
}

.pending-file-action-diff-header > div:first-child {
  width: 100%;
}

.pending-file-action-diff-header > div:first-child span {
  width: 50%;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.pending-file-action-diff-header .diff-mode-toggle {
  grid-template-columns: repeat(2, 78px);
  width: 156px;
  flex: none;
}

.pending-file-action-diff-header .diff-mode-toggle button {
  width: 78px;
  height: 28px;
}

.pending-file-action .pending-file-diff {
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 0.75rem;
}

.pending-file-action-loading,
.pending-file-action-error {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  padding: 18px;
}

.pending-file-action-error {
  color: var(--danger);
}

.chat-error {
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  color: var(--danger);
  padding: 8px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 8px;
}

.chat-composer {
  position: relative;
}

.chat-attachments,
.chat-active-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.chat-attachments > span,
.chat-active-skills > span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-subtle);
  color: var(--muted);
  padding: 3px 5px 3px 7px;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-active-skills .chat-skill-open {
  overflow: hidden;
  max-width: 180px;
  padding: 0;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-response-skills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}

.chat-response-skills > .skill,
.chat-response-skills button {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  font: inherit;
}

.chat-response-skills button {
  cursor: pointer;
}

.agent-skills-settings {
  display: grid;
  gap: 12px;
}
.agent-skills-install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.agent-skills-install .settings-choice,
.agent-skills-install .settings-browse {
  margin: 0;
  white-space: nowrap;
}
.agent-skills-installed {
  display: grid;
  gap: 6px;
}
.agent-skills-installed > strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.agent-skills-installed article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel-subtle);
}
.agent-skills-installed article > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.agent-skills-installed article span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.agent-skills-installed article small {
  color: var(--muted);
}

@media (max-width: 720px) {
  .agent-skills-install {
    grid-template-columns: 1fr 1fr;
  }
  .agent-skills-install select {
    grid-column: 1 / -1;
  }
}

.chat-attachments button,
.chat-active-skills button {
  display: inline-flex;
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 1px;
}

.chat-active-skills > span {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-okf-selector {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.chat-okf-selector > svg {
  flex: none;
}

.chat-okf-selector > span {
  display: inline-flex;
  min-width: 0;
  max-width: 210px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  padding: 3px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-okf-selector button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 1px;
}

.chat-okf-selector button:disabled {
  cursor: default;
  opacity: 0.5;
}

.chat-okf-selector button.add {
  width: 23px;
  height: 23px;
  border: 1px dashed var(--muted);
  border-radius: 50%;
}

.chat-okf-selector button.add:hover:not(:disabled) {
  border-color: var(--text);
  color: var(--text);
}

.chat-okf-menu {
  position: absolute;
  z-index: 24;
  bottom: calc(100% + 5px);
  left: 18px;
  display: grid;
  width: min(310px, calc(100vw - 52px));
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 5px;
  box-shadow: 0 12px 35px rgb(0 0 0 / 0.25);
}

.chat-okf-menu header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 7px;
}

.chat-okf-menu header small,
.chat-okf-menu label small {
  color: var(--muted);
}

.chat-okf-menu label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 5px;
  padding: 6px 7px;
  cursor: pointer;
}

.chat-okf-menu label:hover {
  background: var(--panel-subtle);
}
.chat-okf-menu label input {
  flex: none;
  margin-top: 3px;
}
.chat-okf-menu label span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.chat-okf-menu label strong,
.chat-okf-menu label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.okf-settings-card {
  display: grid;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-subtle);
  padding: 13px;
  font-size: 13px;
}

.okf-settings-card > header {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.okf-settings-card > header > svg {
  flex: none;
  color: #0d9488;
}
.okf-settings-card > header div,
.okf-settings-card > header span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.okf-settings-card small,
.okf-settings-card > p {
  color: var(--muted);
  line-height: 1.45;
}
.okf-settings-card > p {
  margin: 0;
}

.okf-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.okf-settings-row input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 9px;
  font: inherit;
}

.okf-settings-row button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
}

.okf-settings-row button:disabled {
  cursor: default;
  opacity: 0.5;
}

.okf-settings-bundles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
}

.okf-settings-bundles > div {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  padding: 7px 8px;
}

.okf-settings-bundles svg {
  flex: none;
  color: #0d9488;
  margin-top: 1px;
}
.okf-settings-bundles span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.okf-settings-bundles strong,
.okf-settings-bundles small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-picker {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 5px);
  left: 0;
  display: grid;
  max-height: 270px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 35px rgb(0 0 0 / 0.25);
}

.chat-command-menu {
  position: absolute;
  z-index: 21;
  right: 0;
  bottom: calc(100% + 5px);
  left: 0;
  display: grid;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 35px rgb(0 0 0 / 0.25);
  padding: 4px;
}

.chat-command-menu button {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 7px;
  text-align: left;
}

.chat-command-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-command-menu span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 7px;
}

.chat-file-picker input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.72rem;
}

.chat-file-picker > div {
  display: grid;
  overflow: auto;
  padding: 4px;
}

.chat-file-picker > div button {
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
}

.chat-file-picker > div button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-file-picker small {
  color: var(--muted);
  padding: 8px;
}

.chat-input-area textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  padding: 8px;
  resize: none;
  font-size: 0.78rem;
}

.chat-input-area textarea:focus {
  border-color: var(--accent);
}

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.chat-input-actions > span {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.chat-tool-menu-wrap,
.chat-skill-menu-wrap {
  position: relative;
  display: flex;
}

.chat-skill-menu {
  position: absolute;
  z-index: 26;
  bottom: calc(100% + 5px);
  left: 0;
  display: grid;
  width: min(320px, 80vw);
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.3);
  padding: 6px;
}

.chat-skill-menu > header {
  display: grid;
  gap: 2px;
  padding: 5px 7px 8px;
  border-bottom: 1px solid var(--border);
}

.chat-skill-menu > header small,
.chat-skill-menu label small {
  color: var(--muted);
  font-size: 0.62rem;
}

.chat-skill-menu label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
}

.chat-skill-menu label:hover {
  background: var(--panel-subtle);
}

.chat-skill-menu label > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.chat-clear.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-tool-menu {
  position: absolute;
  z-index: 25;
  bottom: calc(100% + 5px);
  left: 0;
  display: grid;
  width: min(285px, 80vw);
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.25);
  padding: 4px;
}

.chat-tool-menu button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.7rem;
}

.chat-tool-menu button:hover,
.chat-tool-menu button.selected {
  background: var(--accent-soft);
  color: var(--accent);
}
.chat-tool-menu-heading {
  margin-top: 3px;
  padding: 6px 8px 3px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
}
.chat-tool-menu > label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.chat-tool-menu > label:hover {
  background: var(--panel-subtle);
}
.chat-tool-menu > label > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.chat-tool-menu > label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.7rem;
  white-space: nowrap;
}
.chat-tool-menu > label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-model-selector {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.chat-model-selector select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  padding: 5px 4px;
  font-size: 0.66rem;
}

.chat-thinking-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.chat-web-search-toggle {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
}
.chat-web-search-toggle input {
  margin: 0;
}

.chat-thinking-select select {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  padding: 4px 3px 4px 0;
  font: inherit;
}

.workflow-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  color: var(--text);
}

.workflow-header,
.workflow-toolbar,
.workflow-path {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.workflow-header {
  justify-content: space-between;
}
.workflow-header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workflow-header button,
.workflow-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-muted);
}
.workflow-toolbar select {
  min-width: 0;
  flex: 1;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-toolbar .workflow-run {
  gap: 4px;
  padding: 0 9px;
  color: var(--accent);
}
.workflow-path {
  padding-block: 5px;
  color: var(--text-muted);
  font-size: 11px;
}
.workflow-path button {
  overflow: hidden;
  border: 0;
  background: none;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.workflow-source {
  flex: 0 0 190px;
  width: 100%;
  min-height: 100px;
  padding: 10px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--border);
  outline: 0;
  background: color-mix(in srgb, var(--surface) 90%, black);
  color: var(--text);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.workflow-error {
  margin: 7px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, #e05252 55%, var(--border));
  border-radius: 6px;
  color: #e46b6b;
  font-size: 11px;
  white-space: pre-wrap;
}
.workflow-graph {
  flex: 1;
  min-height: 100px;
  overflow: auto;
  padding: 8px;
}
.workflow-graph article {
  position: relative;
  margin-bottom: 7px;
  padding: 7px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 7px;
  background: var(--surface-raised);
  cursor: pointer;
}
.workflow-graph article.success {
  border-left-color: #43a66b;
}
.workflow-graph article.error {
  border-left-color: #e05252;
}
.workflow-graph article header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.workflow-graph article header > span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-graph article header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.workflow-graph article header em {
  margin-left: auto;
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
}
.workflow-graph article small {
  display: block;
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-graph article > div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 5px;
  margin-top: 3px;
  font-size: 9px;
}
.workflow-graph article > div b {
  color: var(--text-muted);
}
.workflow-graph article > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-graph article > .workflow-node-order {
  position: absolute;
  top: 29px;
  right: 6px;
  display: flex;
  grid-template-columns: none;
  gap: 2px;
  margin: 0;
}
.workflow-node-order button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
}

.workflow-logs {
  max-height: 180px;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
}
.workflow-logs > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 5px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
}
.workflow-logs > div.error {
  color: #e46b6b;
}
.workflow-logs > div.success > span {
  color: #43a66b;
}
.workflow-logs small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-logs time {
  color: var(--text-muted);
}

/* GemiHub-style workflow side view. */
.workflow-list-header,
.workflow-detail-header {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 7px 10px;
}
.workflow-list-header {
  justify-content: space-between;
}
.workflow-list-header > strong {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.workflow-list-header button,
.workflow-detail-header button {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
}
.workflow-list-header button:hover,
.workflow-detail-header button:hover {
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-detail-header > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
}
.workflow-detail-header > div strong,
.workflow-detail-header > div small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-detail-header > div strong {
  font-size: 11px;
}
.workflow-detail-header > div small {
  color: var(--text-muted);
  font-size: 8px;
}
.workflow-detail-header > button:first-child svg {
  transform: rotate(180deg);
}

.workflow-create-actions {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 10px;
}
.workflow-create-actions button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid color-mix(in srgb, #7c3aed 45%, var(--border));
  border-radius: 6px;
  background: var(--surface);
  color: #7c3aed;
  font-size: 10px;
  font-weight: 600;
}
:root.dark .workflow-create-actions button {
  color: #c4b5fd;
}
.workflow-create-actions button.primary {
  border-color: #7c3aed;
  background: #7c3aed;
  color: white;
}
.workflow-create-actions p {
  margin: 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.4;
}

.workflow-file-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-block: 4px;
}
.workflow-file-list > button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  text-align: left;
}
.workflow-file-list > button:hover {
  background: var(--surface-raised);
}
.workflow-file-list > button > span:first-child {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
}
.workflow-file-list > button > span.workflow {
  background: color-mix(in srgb, #f59e0b 13%, var(--surface));
  color: #d97706;
}
.workflow-file-list > button > span.skill {
  background: color-mix(in srgb, #7c3aed 13%, var(--surface));
  color: #8b5cf6;
}
.workflow-file-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.workflow-file-list strong,
.workflow-file-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-file-list strong {
  font-size: 10px;
}
.workflow-file-list small {
  color: var(--text-muted);
  font-size: 8px;
}
.workflow-list-empty {
  display: flex;
  flex: 1;
  min-height: 140px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  padding: 20px;
  font-size: 10px;
  text-align: center;
}

.workflow-node-list {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding: 5px 7px;
}
.workflow-node-row {
  padding: 2px 0;
}
.workflow-node-row.drop-above {
  border-top: 2px solid var(--accent);
}
.workflow-node-row.drop-below {
  border-bottom: 2px solid var(--accent);
}
.workflow-node-row article {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 7px;
  transition: border-color 120ms ease, opacity 120ms ease;
}
.workflow-node-row article.running {
  border-color: #3b82f6;
}
.workflow-node-row article.success {
  border-color: #43a66b;
}
.workflow-node-row article.error {
  border-color: #e05252;
}
.workflow-node-row article > header {
  display: flex;
  align-items: center;
  gap: 5px;
}
.workflow-node-row article > header > svg:first-child {
  flex: 0 0 auto;
  color: var(--border);
  cursor: grab;
}
.workflow-node-row article > header > em {
  flex: 0 0 auto;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
  padding: 2px 5px;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}
.workflow-node-row article > header > em[data-type="if"],
.workflow-node-row article > header > em[data-type="while"] {
  background: color-mix(in srgb, #f59e0b 14%, var(--surface));
  color: #d97706;
}
.workflow-node-row article > header > em[data-type="command"] {
  background: color-mix(in srgb, #7c3aed 14%, var(--surface));
  color: #8b5cf6;
}
.workflow-node-row article > header > em[data-type="note"] {
  background: color-mix(in srgb, #3b82f6 13%, var(--surface));
  color: #3b82f6;
}
.workflow-node-row article > header > strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.workflow-node-row article > header > button {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
}
.workflow-node-row article > header > button:hover {
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-node-row article > header > button:last-child:hover {
  color: var(--danger);
}
.workflow-node-row article > p {
  overflow: hidden;
  margin: 4px 0 0 17px;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-node-row article > .comment {
  display: block;
  overflow: hidden;
  margin: 3px 0 0 17px;
  color: #d69e2e;
  font-size: 9px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-node-edge {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 2px 19px;
  color: var(--text-muted);
  font-size: 8px;
}
.workflow-node-edge b {
  font-size: 8px;
}
.workflow-node-edge b.true {
  color: #43a66b;
}
.workflow-node-edge b.false {
  color: #e05252;
}

.workflow-skill-side {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.workflow-skill-side > div {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-bottom: 10px;
  color: #8b5cf6;
  text-align: center;
}
.workflow-skill-side > div p {
  margin: 0;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-skill-side > button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 7px;
  text-align: left;
}
.workflow-skill-side > button:hover {
  border-color: var(--accent);
}
.workflow-skill-side > button > span {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.workflow-skill-side > button strong,
.workflow-skill-side > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-skill-side > button small {
  color: var(--text-muted);
  font-size: 8px;
}

.workflow-side-logs {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
}
.workflow-side-logs > button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
  font-size: 8px;
  text-align: left;
}
.workflow-side-logs > button:hover {
  background: var(--surface-raised);
}
.workflow-side-logs > div {
  max-height: 160px;
  overflow: auto;
  padding: 0 8px 4px;
  font: 8px/1.4 ui-monospace, monospace;
}
.workflow-side-logs > div > div {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  padding: 2px;
  color: var(--text-muted);
}
.workflow-side-logs > div > div.success {
  color: #43a66b;
}
.workflow-side-logs > div > div.error {
  color: #e05252;
}
.workflow-side-logs small {
  grid-column: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-side-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding: 7px 8px;
}
.workflow-side-footer button {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 0 7px;
  font-size: 9px;
}
.workflow-side-footer button.execute {
  border-color: #2563eb;
  background: #2563eb;
  color: white;
}
.workflow-side-footer button.stop {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}
.workflow-side-footer button.active {
  color: var(--accent);
}
.workflow-side-footer-more {
  display: flex;
  margin-left: auto;
  gap: 3px;
}
.workflow-side-footer-more button {
  width: 27px;
  padding: 0;
}
.workflow-run-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.workflow-run-status.running {
  color: #3b82f6;
}
.workflow-run-status.completed {
  color: #43a66b;
}
.workflow-run-status.error {
  color: #e05252;
}

/* Pixel-level mapping of WorkflowPropsPanel's Tailwind layout. */
.workflow-panel {
  --workflow-bg: #fff;
  --workflow-raised: #f9fafb;
  --workflow-border: #e5e7eb;
  --workflow-text: #1f2937;
  --workflow-muted: #6b7280;
  background: var(--workflow-bg);
  color: var(--workflow-text);
}
:root.dark .workflow-panel {
  --workflow-bg: #111827;
  --workflow-raised: #1f2937;
  --workflow-border: #1f2937;
  --workflow-text: #e5e7eb;
  --workflow-muted: #9ca3af;
}
.workflow-list-header,
.workflow-detail-header {
  min-height: 41px;
  gap: 4px;
  border-color: var(--workflow-border);
  padding: 8px 12px;
}
.workflow-list-header > strong {
  color: var(--workflow-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.workflow-detail-header {
  justify-content: space-between;
}
.workflow-detail-header > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--workflow-text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-detail-header > div {
  display: flex;
  min-width: auto;
  flex: 0 0 auto;
  gap: 4px;
}
.workflow-list-header button,
.workflow-detail-header button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--workflow-muted);
  padding: 4px;
}
.workflow-list-header button:hover,
.workflow-detail-header button:hover {
  background: var(--workflow-raised);
  color: var(--workflow-text);
}
.workflow-detail-header > button:first-child svg {
  transform: none;
}

.workflow-create-actions {
  gap: 6px;
  border-color: var(--workflow-border);
  padding: 12px;
}
.workflow-create-actions button {
  min-height: 30px;
  gap: 6px;
  border-color: #d8b4fe;
  border-radius: 6px;
  background: var(--workflow-bg);
  color: #7e22ce;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}
:root.dark .workflow-create-actions button {
  border-color: #7e22ce;
  background: var(--workflow-bg);
  color: #d8b4fe;
}
.workflow-create-actions button.primary,
:root.dark .workflow-create-actions button.primary {
  border-color: #9333ea;
  background: #9333ea;
  color: #fff;
}
.workflow-create-actions p {
  color: var(--workflow-muted);
  font-size: 11px;
  line-height: 1.35;
}
.workflow-create-actions p:first-of-type {
  margin-top: 2px;
}

.workflow-file-list {
  padding-block: 4px;
}
.workflow-file-list > button {
  gap: 8px;
  color: var(--workflow-text);
  padding: 6px 12px;
  font-size: 14px;
}
.workflow-file-list > button:hover {
  background: var(--workflow-raised);
}
.workflow-file-list > button > span:first-child {
  width: auto;
  height: auto;
  background: transparent !important;
  color: #f97316 !important;
}
.workflow-file-list > button > span.skill {
  color: #9333ea !important;
}
.workflow-file-list strong {
  font-size: 14px;
  font-weight: 400;
}
.workflow-file-list small {
  color: var(--workflow-muted);
  font-size: 10px;
}
.workflow-list-empty {
  min-height: 160px;
  color: var(--workflow-muted);
  font-size: 12px;
}

.workflow-node-list {
  padding: 4px 0;
}
.workflow-node-row {
  padding: 2px 8px;
}
.workflow-node-row article {
  border-color: var(--workflow-border);
  border-radius: 6px;
  background: var(--workflow-bg);
  padding: 6px 8px;
}
.workflow-node-row article.running {
  border-color: #3b82f6;
}
.workflow-node-row article.success {
  border-color: #4ade80;
}
.workflow-node-row article.error {
  border-color: #f87171;
}
.workflow-node-row article > header {
  gap: 6px;
}
.workflow-node-row article > header > svg:first-child {
  color: #d1d5db;
}
:root.dark .workflow-node-row article > header > svg:first-child {
  color: #4b5563;
}
.workflow-node-row article > header > em {
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}
.workflow-node-row article > header > em[data-color="slate"] {
  background: #f1f5f9;
  color: #1e293b;
}
.workflow-node-row article > header > em[data-color="blue"] {
  background: #dbeafe;
  color: #1e40af;
}
.workflow-node-row article > header > em[data-color="purple"] {
  background: #f3e8ff;
  color: #6b21a8;
}
.workflow-node-row article > header > em[data-color="green"] {
  background: #dcfce7;
  color: #166534;
}
.workflow-node-row article > header > em[data-color="amber"] {
  background: #fef3c7;
  color: #92400e;
}
.workflow-node-row article > header > em[data-color="orange"] {
  background: #ffedd5;
  color: #9a3412;
}
.workflow-node-row article > header > em[data-color="cyan"] {
  background: #cffafe;
  color: #155e75;
}
.workflow-node-row article > header > em[data-color="indigo"] {
  background: #e0e7ff;
  color: #3730a3;
}
:root.dark .workflow-node-row article > header > em[data-color="slate"] {
  background: #1e293b;
  color: #cbd5e1;
}
:root.dark .workflow-node-row article > header > em[data-color="blue"] {
  background: #1e3a8a;
  color: #93c5fd;
}
:root.dark .workflow-node-row article > header > em[data-color="purple"] {
  background: #581c87;
  color: #d8b4fe;
}
:root.dark .workflow-node-row article > header > em[data-color="green"] {
  background: #14532d;
  color: #86efac;
}
:root.dark .workflow-node-row article > header > em[data-color="amber"] {
  background: #78350f;
  color: #fcd34d;
}
:root.dark .workflow-node-row article > header > em[data-color="orange"] {
  background: #7c2d12;
  color: #fdba74;
}
:root.dark .workflow-node-row article > header > em[data-color="cyan"] {
  background: #164e63;
  color: #67e8f9;
}
:root.dark .workflow-node-row article > header > em[data-color="indigo"] {
  background: #312e81;
  color: #a5b4fc;
}
.workflow-node-row article > header > strong {
  color: var(--workflow-text);
  font-size: 14px;
  font-weight: 500;
}
.workflow-node-row article > header > button {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--workflow-muted);
  padding: 2px;
}
.workflow-node-row article > header > button:hover {
  background: var(--workflow-raised);
  color: var(--workflow-text);
}
.workflow-node-row article > p {
  margin: 2px 0 0;
  color: var(--workflow-muted);
  font-size: 11px;
}
.workflow-node-row article > .comment {
  margin: 2px 0 0;
  color: #d97706;
  font-size: 11px;
}
.workflow-node-edge {
  gap: 4px;
  margin: 2px 0 2px 12px;
  color: var(--workflow-muted);
  font-size: 10px;
}
.workflow-node-edge b {
  font-size: 10px;
}

.workflow-side-logs {
  border-color: var(--workflow-border);
}
.workflow-side-logs > button {
  gap: 4px;
  color: var(--workflow-muted);
  padding: 4px 12px;
  font-size: 10px;
}
.workflow-side-logs > button:hover {
  background: var(--workflow-raised);
}
.workflow-side-logs > div {
  max-height: 192px;
  padding: 0 8px 4px;
  font-size: 10px;
  line-height: 1.5;
}
.workflow-side-logs > div > .workflow-side-log {
  display: block;
  padding: 0;
  color: var(--workflow-muted);
}
.workflow-side-log > div:first-child {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  border-radius: 4px;
  padding: 2px;
}
.workflow-side-log > div:first-child.expandable {
  cursor: pointer;
}
.workflow-side-log > div:first-child.expandable:hover {
  background: var(--workflow-raised);
}
.workflow-side-log > div:first-child > svg {
  flex: 0 0 auto;
  margin-top: 2px;
}
.workflow-side-log > div:first-child > b {
  flex: 0 0 auto;
  color: var(--workflow-muted);
  font-weight: 400;
}
.workflow-side-log > div:first-child > span {
  overflow-wrap: anywhere;
}
.workflow-side-log > div:first-child > button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 0;
  background: transparent;
  color: #6366f1;
  padding: 0;
}
.workflow-side-log.success > div:first-child {
  color: #16a34a;
}
:root.dark .workflow-side-log.success > div:first-child {
  color: #4ade80;
}
.workflow-side-log.error > div:first-child {
  color: #ef4444;
}
.workflow-side-log-details {
  display: grid;
  gap: 4px;
  margin: 0 0 4px 20px;
}
.workflow-side-log-details section > b {
  color: var(--workflow-muted);
  font-weight: 600;
}
.workflow-side-log-details pre {
  max-height: 96px;
  overflow: auto;
  margin: 2px 0 0;
  border-radius: 4px;
  background: #f3f4f6;
  color: #374151;
  padding: 4px;
  font: inherit;
  white-space: pre-wrap;
}
:root.dark .workflow-side-log-details pre {
  background: #1f2937;
  color: #d1d5db;
}

.workflow-side-footer {
  flex-wrap: nowrap;
  gap: 8px;
  border-color: var(--workflow-border);
  background: var(--workflow-bg);
  padding: 8px 12px;
}
.workflow-side-footer button {
  min-height: 28px;
  gap: 4px;
  border-color: #d1d5db;
  border-radius: 4px;
  background: var(--workflow-bg);
  color: #374151;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}
:root.dark .workflow-side-footer button {
  border-color: #4b5563;
  color: #d1d5db;
}
.workflow-side-footer button.execute {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.workflow-side-footer button.stop {
  border-color: transparent;
  background: #fee2e2;
  color: #b91c1c;
}
:root.dark .workflow-side-footer button.stop {
  background: #7f1d1d;
  color: #fca5a5;
}
.workflow-side-footer button:nth-of-type(3) {
  border-color: transparent;
  background: #f3e8ff;
  color: #7e22ce;
}
:root.dark .workflow-side-footer button:nth-of-type(3) {
  background: color-mix(in srgb, #581c87 65%, transparent);
  color: #d8b4fe;
}
.workflow-run-status {
  margin-left: auto;
}

.workflow-history {
  flex: 1;
  overflow: auto;
  padding: 8px;
}
.workflow-history > header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}
.workflow-history > header > strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.workflow-history > header > button {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 0 7px;
  font-size: 9px;
}
.workflow-history > header > button:first-child svg {
  transform: rotate(180deg);
}
.workflow-history details {
  margin-bottom: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}
.workflow-history summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  padding: 7px;
  cursor: pointer;
  font-size: 10px;
}
.workflow-history summary span {
  text-transform: uppercase;
  color: var(--text-muted);
}
.workflow-history summary span.completed {
  color: #43a66b;
}
.workflow-history summary span.error {
  color: #e46b6b;
}
.workflow-history summary time {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-history pre {
  overflow: auto;
  max-height: 180px;
  margin: 0;
  padding: 8px;
  border-top: 1px solid var(--border);
  font-size: 9px;
  white-space: pre-wrap;
}
.workflow-history-delete {
  margin: 7px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: #e46b6b;
  font-size: 9px;
}

.workflow-history-steps {
  border-top: 1px solid var(--border);
}
.workflow-history-steps > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
}
.workflow-history-steps > div > span {
  color: var(--text-muted);
}
.workflow-history-steps > div > strong {
  grid-column: 1;
  font-weight: 500;
}
.workflow-history-step-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.workflow-history-step-actions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 9px;
}
.workflow-history-steps > div > time {
  grid-column: 2;
  grid-row: 2;
  color: var(--text-muted);
  font-size: 9px;
  text-align: right;
}
.workflow-history-steps > div > details {
  grid-column: 1 / -1;
  margin-top: 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.workflow-history-steps > div > details summary {
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
}
.workflow-history-steps > div > details b {
  display: block;
  padding: 5px 6px 0;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-history-steps > div > details pre {
  max-height: 180px;
  overflow: auto;
  margin: 3px 6px 6px;
  padding: 6px;
  border-radius: 4px;
  background: var(--surface);
  white-space: pre-wrap;
}

.workflow-modal-backdrop {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(0 0 0 / 55%);
}
.workflow-automation-modal {
  width: min(480px, 100%);
  max-height: min(680px, 90vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}
.workflow-automation-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.workflow-automation-modal > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workflow-automation-modal > header button {
  border: 0;
  background: none;
  color: var(--text-muted);
}
.workflow-automation-modal fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.workflow-automation-modal legend {
  padding: 0 5px;
  color: var(--text-muted);
  font-size: 11px;
}
.workflow-automation-modal fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.workflow-modal-field {
  display: grid;
  gap: 6px;
  margin: 12px 14px;
}
.workflow-modal-field > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}
.workflow-modal-field input {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-modal-field small {
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-automation-modal > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
}
.workflow-automation-modal > footer button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-automation-modal > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.workflow-prompt-modal {
  width: min(640px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}
.workflow-prompt-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.workflow-prompt-modal > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workflow-prompt-modal > header button {
  border: 0;
  background: none;
  color: var(--text-muted);
}
.workflow-prompt-content {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.workflow-prompt-content > input,
.workflow-prompt-content > textarea,
.workflow-prompt-content label input,
.workflow-prompt-content label textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-prompt-content textarea {
  resize: vertical;
}
.workflow-prompt-content p {
  margin: 0;
  white-space: pre-wrap;
}
.workflow-prompt-content label {
  display: grid;
  gap: 5px;
  font-size: 11px;
}
.workflow-file-search {
  display: flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.workflow-file-options {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.workflow-file-options button {
  display: block;
  width: 100%;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-file-options button.selected {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.workflow-confirm-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.workflow-confirm-meta span {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--accent);
  font-size: 10px;
}
.workflow-prompt-content details pre,
.workflow-confirm-preview {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 90%, black);
  font: 10px/1.45 ui-monospace, monospace;
  white-space: pre-wrap;
}
.workflow-dialog-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.workflow-dialog-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.workflow-dialog-options input {
  width: auto !important;
}
.workflow-prompt-modal > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
}
.workflow-prompt-modal > footer button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-prompt-modal > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.workflow-node-modal {
  width: min(720px, 100%);
  max-height: min(820px, 94vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}
.workflow-node-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.workflow-node-modal > header button {
  border: 0;
  background: none;
  color: var(--text-muted);
}
.workflow-node-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.workflow-node-fields > label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.workflow-node-fields > label.wide {
  grid-column: 1 / -1;
}
.workflow-node-fields > label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 10px;
}
.workflow-node-fields > label > span button {
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--text-muted);
}
.workflow-node-fields input,
.workflow-node-fields select,
.workflow-node-fields textarea {
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  font: 11px/1.4 inherit;
}
.workflow-node-fields textarea {
  resize: vertical;
  font-family: ui-monospace, monospace;
}
.workflow-add-property {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
}
.workflow-add-property select,
.workflow-add-property input {
  flex: 1;
}
.workflow-add-property button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-node-modal > footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
}
.workflow-node-modal > footer > span {
  flex: 1;
}
.workflow-node-modal > footer button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-node-modal > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.workflow-node-modal > footer button.danger {
  color: #e46b6b;
}

.workflow-progress-modal {
  width: min(700px, 100%);
  max-height: min(820px, 94vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}
.workflow-progress-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.workflow-progress-modal > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.workflow-progress-modal > header span {
  color: var(--text-muted);
  font-size: 10px;
}
.workflow-progress-modal > header button {
  border: 0;
  background: none;
  color: var(--text-muted);
}
.workflow-progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 7px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
}
.workflow-progress-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 7px;
  background: var(--surface-raised);
}
.workflow-progress-list article.success {
  border-left-color: #43a66b;
}
.workflow-progress-list article.error {
  border-left-color: #e05252;
}
.workflow-progress-list article.info {
  border-left-color: var(--accent);
}
.workflow-progress-list article > span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 9px;
}
.workflow-progress-list article > div {
  min-width: 0;
}
.workflow-progress-list article strong,
.workflow-progress-list article small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-progress-list article small,
.workflow-progress-list article em {
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
}
.workflow-progress-list article p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #e46b6b;
  font-size: 9px;
}
.workflow-progress-mcp {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
  font-size: 9px;
}
.workflow-progress-thinking {
  grid-column: 1 / -1;
  min-width: 0;
  border-top: 1px solid var(--border);
}
.workflow-progress-thinking summary {
  padding-top: 5px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-progress-thinking b {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-progress-thinking pre {
  max-height: 140px;
  overflow: auto;
  margin: 5px 0 0;
  padding: 6px;
  border-radius: 5px;
  background: var(--surface);
  font-size: 9px;
  white-space: pre-wrap;
}
.workflow-progress-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-confirm-diff {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-monospace);
  font-size: 10px;
}
.workflow-confirm-diff > div {
  display: grid;
  grid-template-columns: 32px 32px 14px minmax(180px, 1fr);
  min-height: 23px;
  align-items: start;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.workflow-confirm-diff > div > span,
.workflow-confirm-diff > div > b {
  padding: 4px;
  color: var(--text-muted);
  text-align: right;
  font-weight: 400;
  user-select: none;
}
.workflow-confirm-diff > div > code {
  padding: 4px 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.workflow-confirm-diff > div.added {
  background: color-mix(in srgb, #43a66b 14%, transparent);
}
.workflow-confirm-diff > div.removed {
  background: color-mix(in srgb, #e05252 14%, transparent);
}
.workflow-confirm-diff > div.added > b {
  color: #43a66b;
}
.workflow-confirm-diff > div.removed > b {
  color: #e05252;
}
.workflow-confirm-diff > div > input {
  grid-column: 4;
  margin: 2px 5px 5px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
}
.workflow-progress-log {
  flex: 1;
  min-height: 100px;
  overflow: auto;
  border-block: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, black);
}
.workflow-progress-log > div {
  display: grid;
  grid-template-columns: auto 90px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 5px 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 9px;
}
.workflow-progress-log time,
.workflow-progress-log em {
  color: var(--text-muted);
  font-style: normal;
}
.workflow-progress-log > div.error {
  color: #e46b6b;
}
.workflow-progress-modal > footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
}
.workflow-progress-modal > footer button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-progress-modal > footer button.danger {
  color: #e46b6b;
}

.dashboard-workflow-widget {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.dashboard-workflow-widget > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.dashboard-workflow-widget > header > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.dashboard-workflow-widget > header span,
.dashboard-workflow-widget > header em {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
}
.dashboard-workflow-widget > header em {
  color: #d89b3c;
}
.dashboard-workflow-widget > header button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-workflow-widget > header button.danger {
  padding-inline: 5px;
  color: #e46b6b;
}
.dashboard-workflow-widget .spin {
  animation: workflow-spin 1s linear infinite;
}
@keyframes workflow-spin {
  to {
    transform: rotate(360deg);
  }
}
.dashboard-workflow-config {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 7px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.dashboard-workflow-config label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-workflow-config input,
.dashboard-workflow-config select {
  min-width: 0;
  height: 27px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
}
.dashboard-workflow-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  align-self: end;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 9px;
}
.dashboard-workflow-output {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 9px;
}
.dashboard-workflow-output > p {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.dashboard-workflow-output iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.dashboard-workflow-output:has(.dashboard-workflow-structured) {
  overflow: hidden;
  padding: 0;
}
.dashboard-workflow-structured {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}
.workflow-view-controls {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding: 5px 7px;
}
.workflow-view-controls label {
  display: flex;
  min-width: 80px;
  flex: 1;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.workflow-view-controls input,
.workflow-view-controls select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 9px;
}
.workflow-view-controls span {
  flex: none;
  color: var(--text-muted);
  font-size: 8px;
}
.dashboard-workflow-structured > .dashboard-workflow-table,
.dashboard-workflow-structured > .dashboard-workflow-cards {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.workflow-data-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}
.workflow-data-card > img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}
.workflow-data-card > div {
  display: grid;
  gap: 3px;
  padding: 8px;
}
.workflow-data-card > div > strong {
  font-size: 11px;
}
.workflow-data-card small {
  color: var(--text-muted);
  font-size: 9px;
}
.workflow-data-card p {
  margin: 3px 0;
  color: var(--text);
  font-size: 9px;
  white-space: pre-wrap;
}
.workflow-data-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.workflow-data-card footer span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 5px;
  font-size: 8px;
}
.dashboard-workflow-error {
  padding: 6px 8px;
  border-bottom: 1px solid color-mix(in srgb, #e05252 40%, var(--border));
  color: #e46b6b;
  font-size: 10px;
}

.ai-workflow-builder {
  width: min(820px, 100%);
  max-height: min(900px, 95vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(0 0 0 / 40%);
}
.ai-workflow-builder > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.ai-workflow-builder > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ai-workflow-builder > header button {
  border: 0;
  background: none;
  color: var(--text-muted);
}
.ai-workflow-input,
.ai-workflow-review,
.ai-workflow-result {
  display: grid;
  gap: 11px;
  padding: 15px;
}
.ai-workflow-input > label,
.ai-workflow-review > label,
.ai-workflow-result > label,
.ai-workflow-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.ai-workflow-input label > span,
.ai-workflow-review label > span,
.ai-workflow-result label > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}
.ai-workflow-input input,
.ai-workflow-input select,
.ai-workflow-input textarea,
.ai-workflow-review textarea,
.ai-workflow-result textarea {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.ai-workflow-input textarea,
.ai-workflow-review textarea,
.ai-workflow-result textarea {
  resize: vertical;
}
.ai-workflow-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 9px;
}
.ai-workflow-attachments {
  position: relative;
  display: grid;
  gap: 5px;
}
.ai-workflow-attachments > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}
.ai-workflow-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ai-workflow-attachment-list > span,
.ai-workflow-attachment-list > button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 4px 7px;
  font-size: 11px;
}
.ai-workflow-attachment-list > span button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
}
.ai-workflow-attachment-picker {
  display: grid;
  max-height: 230px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 25px rgb(0 0 0 / 20%);
}
.ai-workflow-attachment-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 7px;
}
.ai-workflow-attachment-picker label input {
  border: 0;
  outline: 0;
}
.ai-workflow-attachment-picker > div {
  display: grid;
  overflow: auto;
  padding: 4px;
}
.ai-workflow-attachment-picker > div button {
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 6px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-workflow-attachment-picker > div button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.ai-workflow-attachment-picker small {
  color: var(--text-muted);
  padding: 8px;
}
.ai-workflow-input fieldset {
  display: grid;
  gap: 5px;
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ai-workflow-input fieldset legend {
  padding: 0 5px;
  color: var(--text-muted);
  font-size: 10px;
}
.ai-workflow-input fieldset label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.ai-workflow-input fieldset.ai-workflow-history-select {
  max-height: 230px;
}
.ai-workflow-history-select details {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  padding: 3px 0;
}
.ai-workflow-history-select details:last-child {
  border-bottom: 0;
}
.ai-workflow-history-select summary {
  cursor: pointer;
}
.ai-workflow-history-select details > label {
  padding: 3px 4px 3px 22px;
  align-items: flex-start;
}
.ai-workflow-history-select details > label span {
  display: grid;
  gap: 1px;
}
.ai-workflow-history-select details > label small {
  color: var(--text-muted);
}
.ai-workflow-input footer,
.ai-workflow-review footer,
.ai-workflow-result footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ai-workflow-input footer button,
.ai-workflow-review footer button,
.ai-workflow-result footer button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
}
.ai-workflow-input footer button.primary,
.ai-workflow-review footer button.primary,
.ai-workflow-result footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.ai-workflow-progress {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px;
}
.ai-workflow-progress details {
  width: 100%;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ai-workflow-progress summary {
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
}
.ai-workflow-progress pre {
  margin: 0;
  padding: 8px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  white-space: pre-wrap;
}
.ai-workflow-phases {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.ai-workflow-phases span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 9px;
}
.ai-workflow-phases span.active {
  border-color: var(--accent);
  color: var(--accent);
}
.ai-workflow-phases span.done {
  border-color: #43a66b;
  color: #43a66b;
}
.ai-workflow-review > pre,
.ai-workflow-result details > pre {
  max-height: 380px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, black);
  font: 10px/1.45 ui-monospace, monospace;
  white-space: pre-wrap;
}
.ai-workflow-result > section {
  padding: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid #e0a040;
  border-radius: 7px;
  background: var(--surface-raised);
}
.ai-workflow-result > section.pass {
  border-left-color: #43a66b;
}
.ai-workflow-result > section > p {
  margin: 6px 0;
  font-size: 11px;
}
.ai-workflow-result > section article {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 10px;
}
.ai-workflow-result > section article b {
  color: #e0a040;
}
.ai-workflow-result > section article small {
  color: var(--text-muted);
}
.ai-workflow-improvements {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}
.ai-workflow-improvements > summary {
  width: fit-content;
  padding: 2px 0;
  cursor: pointer;
}
.ai-workflow-result > section.pass .ai-workflow-improvements article b {
  color: var(--text-muted);
  font-weight: 500;
}
.ai-workflow-risk {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}
.ai-workflow-usage {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ai-workflow-diff {
  min-height: 0;
}
.unified-diff {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.unified-diff > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10px;
}
.unified-diff > header strong {
  margin-right: auto;
}
.unified-diff > header .added {
  color: #059669;
}
.unified-diff > header .removed {
  color: #dc2626;
}
.ai-workflow-diff .history-diff-pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 0;
  font: 10px/1.45 ui-monospace, monospace;
}
.modify-skill-ai {
  width: min(980px, 100%);
}
.modify-skill-ai-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}
.modify-skill-ai-summary span {
  color: var(--text-muted);
  font-size: 10px;
}
.modify-skill-ai details > ul {
  margin: 6px 0 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 10px;
}
.modify-skill-file-diffs {
  display: grid;
  gap: 8px;
}
.modify-skill-file-diffs > details {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.modify-skill-file-diffs > details > summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--surface-raised);
  font-size: 10px;
}
.modify-skill-file-diffs > details > summary span {
  color: var(--text-muted);
}
.modify-skill-file-diffs .workflow-confirm-diff {
  max-height: 300px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.agent-skill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 720px) {
  .ai-workflow-diff {
    grid-template-columns: 1fr;
  }
}

.workflow-mcp-app-modal {
  display: flex;
  width: min(900px, 94vw);
  height: min(720px, 90vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(0 0 0 / 40%);
}

.workflow-mcp-app-modal.expanded {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
}

.workflow-mcp-app-modal > header,
.workflow-mcp-app-modal > footer {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}

.workflow-mcp-app-modal > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.workflow-mcp-app-modal > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.workflow-mcp-app-modal > header span {
  color: var(--text-muted);
  font-size: 10px;
}
.workflow-mcp-app-modal button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
}
.workflow-mcp-app-modal iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: white;
}

.workflow-skill-summary {
  display: grid;
  gap: 6px;
  margin: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
}

.workflow-skill-summary > header,
.workflow-skill-summary > button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-skill-summary > header > div,
.workflow-skill-summary > button > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workflow-skill-summary > header span,
.workflow-skill-summary small,
.workflow-skill-summary p {
  color: var(--text-muted);
  font-size: 10px;
}
.workflow-skill-summary > button {
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.chat-send {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--panel);
  cursor: pointer;
}

.chat-send:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.markdown-with-properties {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.markdown-with-properties > .dashboard-scaled-preview {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.file-widget-wysiwyg-selection-root {
  flex: 1;
  min-height: 0;
}

.frontmatter-editor {
  position: relative;
  z-index: 2;
  flex: none;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 9px 12px;
  color: var(--text);
}

.frontmatter-heading {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 650;
}

.frontmatter-heading svg {
  transition: transform 140ms ease;
}

.frontmatter-heading svg.expanded {
  transform: rotate(90deg);
}

.frontmatter-properties {
  display: grid;
  max-height: min(50vh, 300px);
  gap: 2px;
  overflow-y: auto;
  margin-top: 7px;
}

.frontmatter-property {
  display: grid;
  grid-template-columns: 34px minmax(80px, 140px) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  padding: 2px 3px;
  font-size: 0.72rem;
}

.frontmatter-property:hover {
  background: var(--panel-subtle);
}

.frontmatter-property.drag-over {
  border-top: 2px solid var(--accent);
}

.frontmatter-property.dragging {
  opacity: 0.4;
}

.frontmatter-type {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  color: var(--muted);
}

.frontmatter-grip {
  cursor: grab;
  opacity: 0;
}

.frontmatter-property:hover .frontmatter-grip {
  opacity: 1;
}

.frontmatter-property > strong,
.frontmatter-key {
  overflow: hidden;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frontmatter-key:focus,
.frontmatter-value:focus,
.frontmatter-list input:focus {
  border-bottom-color: var(--accent);
}

.frontmatter-value,
.frontmatter-list input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.frontmatter-value-text {
  overflow: hidden;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.frontmatter-checkbox {
  display: flex;
  align-items: center;
}

.frontmatter-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.frontmatter-list > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 4px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 2px 5px;
}

.frontmatter-list button {
  display: flex;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.frontmatter-list input {
  width: 64px;
}

.frontmatter-add,
.frontmatter-add-bar button {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 7px 2px 0;
  font-size: 0.71rem;
}

.frontmatter-add-bar {
  flex: none;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 7px 12px;
}

.frontmatter-add-bar button {
  padding: 0;
}

.frontmatter-invalid {
  margin-top: 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  padding: 6px 8px;
  font-size: 0.7rem;
}

.frontmatter-menu-backdrop {
  position: fixed;
  z-index: 199;
  inset: 0;
  border: 0;
  background: transparent;
}

.frontmatter-menu {
  position: fixed;
  z-index: 200;
  display: grid;
  width: 165px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.28);
  padding: 5px;
}

.frontmatter-menu small {
  color: var(--muted);
  padding: 4px 6px;
}

.frontmatter-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  text-align: left;
  font-size: 0.7rem;
}

.frontmatter-menu button:hover,
.frontmatter-menu button.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.frontmatter-menu button.danger {
  color: var(--danger);
}

.rag-search-panel {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--panel);
  color: var(--text);
}

.rag-search-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
}

.rag-search-header > div,
.rag-search-header > button {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rag-search-header > button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.rag-search-controls {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 8px;
}

.rag-search-setting-row select,
.rag-search-parameters input,
.rag-search-query textarea,
.rag-search-result-tools input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.rag-search-setting-row select {
  width: 100%;
  padding: 6px;
  font-size: 0.72rem;
}

.rag-search-parameters {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 1fr;
  gap: 5px;
}

.rag-search-parameters label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.62rem;
}

.rag-search-parameters input {
  width: 100%;
  padding: 5px;
  font-size: 0.68rem;
}

.rag-search-query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
}

.rag-search-query textarea {
  resize: none;
  padding: 7px;
  font-size: 0.72rem;
}

.rag-search-query > button,
.rag-search-result-tools button,
.rag-search-empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--panel);
  cursor: pointer;
  padding: 6px;
  font-size: 0.66rem;
}

.rag-search-query > button:disabled,
.rag-search-result-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rag-search-results {
  min-height: 0;
  overflow: auto;
  padding: 7px;
}

.rag-search-inline-config {
  display: grid;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 8px;
}
.rag-search-inline-config > label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: .7rem;
}
.rag-search-inline-config input,
.rag-search-inline-config textarea,
.rag-search-filter-stack select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 6px;
}
.rag-search-sync {
  display: flex;
  gap: 6px;
}
.rag-search-sync button,
.rag-search-full-settings,
.rag-search-filter-stack > button,
.rag-search-filter-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 5px 7px;
}
.rag-search-inline-config progress {
  width: 100%;
}
.rag-indexed-files {
  display: grid;
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.rag-indexed-files > button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px;
  text-align: left;
}
.rag-indexed-files > button:last-child {
  border-bottom: 0;
}
.rag-indexed-files span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rag-indexed-files small {
  flex: none;
  color: var(--text-muted);
}
.rag-search-filter-stack {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding: 7px;
}
.rag-search-filter-row {
  display: flex;
  gap: 4px;
}
.rag-search-filter-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 6px;
}
.rag-search-filter-row button {
  flex: none;
  padding: 5px;
}
.rag-search-result-tools > label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rag-search-results article > header select {
  min-width: 58px;
  max-width: 70px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: .65rem;
}
.rag-media-preview {
  display: grid;
  min-height: 100px;
  place-items: center;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: #111;
}
.rag-media-preview iframe {
  width: 100%;
  height: 360px;
  border: 0;
}
.rag-media-preview .pdf-viewer {
  width: 100%;
  height: 420px;
  min-height: 0;
}
.rag-media-preview img,
.rag-media-preview video {
  max-width: 100%;
  max-height: 360px;
}
.rag-media-preview audio {
  width: calc(100% - 16px);
  margin: 12px 8px;
}
.rag-media-preview span {
  color: var(--text-muted);
  padding: 18px;
}

.rag-search-result-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}

.rag-search-result-tools input {
  padding: 6px;
  font-size: 0.68rem;
}

.rag-search-result-tools > span {
  color: var(--muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.rag-search-results article {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  margin-bottom: 6px;
}

.rag-search-results article.selected {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--panel));
}

.rag-search-results article > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding: 5px 6px;
}

.rag-search-results article > header label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rag-search-score {
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.6rem;
}

.rag-search-file,
.rag-search-expand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 2px;
}

.rag-search-file > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.67rem;
}

.rag-search-file > small {
  color: var(--muted);
  font-size: 0.56rem;
  white-space: nowrap;
}

.rag-search-file > em {
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 4px;
  font-size: 0.54rem;
  font-style: normal;
}

.rag-search-expand,
.rag-search-edit {
  display: flex;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
}

.rag-search-edit:hover {
  color: var(--accent);
}

.rag-search-results article > p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  color: var(--text);
  margin: 0;
  padding: 7px 8px;
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.rag-search-results article > p.expanded {
  display: block;
  overflow: visible;
}

.rag-search-error,
.rag-search-no-results {
  border-radius: 6px;
  color: var(--muted);
  padding: 10px;
  font-size: 0.7rem;
}

.rag-search-error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.rag-search-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
  text-align: center;
}

.rag-search-empty span {
  color: var(--muted);
  font-size: 0.72rem;
}

.spin {
  animation: rag-search-spin 0.8s linear infinite;
}

@keyframes rag-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.rag-edit-backdrop {
  position: fixed;
  z-index: 350;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.48);
  padding: 24px;
}

.rag-edit-modal {
  display: grid;
  width: min(760px, 92vw);
  max-height: min(760px, 90vh);
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
  padding: 12px;
}

.rag-edit-modal > header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rag-edit-modal > header > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.rag-edit-modal > header small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rag-edit-modal > header button,
.rag-edit-modal > footer button,
.rag-edit-adjacent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.7rem;
}

.rag-edit-adjacent {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.rag-edit-modal button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rag-edit-modal > textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
}

.rag-edit-modal > textarea:focus {
  border-color: var(--accent);
}

.rag-edit-modal > footer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rag-edit-modal > footer > span {
  flex: 1;
}

.rag-edit-modal > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
}

.file-tree-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.file-tree-header,
.file-tree-actions,
.file-tree-row,
.file-tree-entry,
.file-tree-row-actions,
.file-tree-search {
  display: flex;
  align-items: center;
}

.file-tree-header {
  justify-content: space-between;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 5px 7px;
}

.file-tree-mode-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding: 5px 7px;
}
.file-tree-title {
  display: inline-flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  padding: 5px;
  font-size: 0.76rem;
}
.file-tree-mode-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  font-size: 0.7rem;
}
.file-tree-mode-bar > div button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.file-tree-mode-bar .file-tree-collapse,
.file-tree-mode-bar .file-tree-refresh,
.file-tree-mode-bar .workspace-directory-open {
  width: 27px;
  height: 27px;
  flex: none;
  padding: 0;
}
.file-tree-mode-bar .file-tree-collapse:hover,
.file-tree-mode-bar .file-tree-refresh:hover,
.file-tree-mode-bar .workspace-directory-open:hover {
  background: var(--panel-subtle);
  color: var(--text);
}

.file-tree-project {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 3px 5px;
}
.file-tree-project > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.file-tree-project small {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}
.file-tree-project strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}
.file-tree-project-picker {
  display: grid;
  flex: none;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 7px;
}
.file-tree-project-picker label {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.file-tree-project-picker select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 7px;
  font-size: 0.72rem;
}
.file-tree-workspace-empty {
  padding: 20px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.file-tree-root,
.file-tree-actions button,
.file-tree-row-actions button {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.file-tree-root {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 5px;
}

.file-tree-root strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tree-root > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.file-tree-root small {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-align: left;
}

.file-tree-actions {
  flex: none;
  gap: 1px;
}

.file-tree-actions button,
.file-tree-row-actions button {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.file-tree-actions button:hover,
.file-tree-row-actions button:hover,
.file-tree-row:hover {
  background: var(--panel-subtle);
}

.file-tree-search {
  gap: 6px;
  margin: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
}

.file-tree-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 0;
  font-size: 0.82rem;
}

.file-tree-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 2px 5px 12px;
}
.file-tree-scroll.accept-external-drop {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.file-tree-block {
  min-height: 32px;
  border-radius: 7px;
}
.file-tree-block.workspace-block {
  padding-bottom: 8px;
}
.workspace-tree-drop-zone {
  display: grid;
  min-height: 72px;
  place-items: center;
  margin: 5px 3px 0;
  border: 1px dashed transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  transition: border-color .12s ease, background .12s ease, min-height .12s
    ease;
}
.workspace-tree-drop-zone.active {
  min-height: 88px;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
}
.workspace-tree-drop-zone.external-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 10px color-mix(in srgb,
    var(--accent) 28%, transparent);
  color: var(--accent);
  font-weight: 700;
}
.file-tree-block.external-block {
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, #d58c32 35%, var(--border));
  background: color-mix(in srgb, #d58c32 5%, var(--panel));
  padding: 4px;
}
.file-tree-block.external-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid color-mix(in srgb, #d58c32 25%, var(--border));
  margin-bottom: 3px;
  padding: 6px 5px;
  color: #c47b24;
}
.file-tree-block.external-block > header span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
}
.file-tree-block.external-block > header small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tree-row.external {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.file-tree-row:not(.external) {
  touch-action: none;
}
.file-tree-row.external:active {
  cursor: grabbing;
  opacity: 0.65;
}
.file-tree-panel.file-move-active,
.file-tree-panel.file-move-active * {
  cursor: grabbing !important;
}
.file-tree-panel.file-move-can-drop,
.file-tree-panel.file-move-can-drop * {
  cursor: move !important;
}
.file-tree-row.external.selected {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  box-shadow: inset 2px 0 0 var(--accent);
}
.file-tree-row.external.selected .file-tree-entry {
  color: var(--accent);
}
.file-tree-row.external-drop-target {
  position: relative;
  background: color-mix(in srgb, var(--accent) 24%, var(--panel));
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px color-mix(in srgb,
    var(--accent) 65%, transparent);
}
.file-tree-row.external-drop-target .file-tree-entry {
  color: var(--accent);
  font-weight: 700;
}
.file-tree-row.external-drop-target .file-tree-entry svg {
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 55%,
    transparent));
}
.binary-download-view {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  background: var(--panel-subtle);
}
.binary-download-view > div {
  display: grid;
  width: min(460px, 100%);
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 26px;
  text-align: center;
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}
.binary-download-view h3,
.binary-download-view p {
  margin: 0;
  overflow-wrap: anywhere;
}
.binary-download-view p {
  color: var(--muted);
  font-size: 0.82rem;
}
.binary-download-view button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  padding: 8px 13px;
}
.binary-download-view button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.workspace-move-warning {
  border: 1px solid color-mix(in srgb, #d58c32 45%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, #d58c32 9%, var(--panel));
  color: var(--text);
  padding: 9px 10px;
  font-size: 0.78rem;
  line-height: 1.45;
}
.workspace-move-sources {
  display: grid;
  max-height: 130px;
  gap: 3px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-subtle);
  padding: 7px;
}
.workspace-move-sources small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-row {
  min-height: 29px;
  border-radius: 5px;
  padding-right: 3px;
}

.file-tree-entry {
  flex: 1;
  min-width: 0;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 5px 0;
}

.file-tree-entry > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-chevron {
  display: inline-flex;
  width: 14px;
  flex: none;
}

.file-tree-row-actions {
  display: none;
  flex: none;
}

.file-tree-row:hover .file-tree-row-actions {
  display: flex;
}

.file-tree-content-results {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding: 10px 4px;
}

.file-tree-content-results > strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.file-tree-content-results button {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  text-align: left;
}

.file-tree-content-results button:hover {
  background: var(--panel-subtle);
}

.file-tree-content-results small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spin {
  animation: spin 0.8s linear infinite;
}

/* Desktop readability: navigation labels should remain legible at 100% zoom. */
.file-tree-mode-bar button {
  font-size: 12px;
}
.file-tree-project small,
.file-tree-root small,
.file-tree-project-picker label {
  font-size: 11px;
}
.file-tree-project strong,
.file-tree-root strong {
  font-size: 14px;
}
.file-tree-project-picker select,
.file-tree-workspace-empty,
.file-tree-search input,
.file-tree-entry {
  font-size: 13px;
}
.file-tree-content-results > strong {
  font-size: 11px;
}
.file-tree-content-results button {
  font-size: 13px;
}
.file-tree-content-results small {
  font-size: 12px;
}

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

.topbar,
.modebar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.topbar {
  position: relative;
  z-index: 300;
  overflow: visible;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
}

.document-meta {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.document-meta-inline {
  flex: 1;
}

.app-title {
  flex: none;
}

.app-menu-trigger {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 6px 7px;
}

.app-menu-trigger:hover,
.app-menu-trigger[aria-expanded="true"] {
  background: var(--panel-subtle);
}

.app-menu-trigger > svg:last-child {
  color: var(--muted);
}

.app-menu-popover {
  position: absolute;
  z-index: 310;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  width: min(360px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 70px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgb(0 0 0 / 24%);
  padding: 6px;
}

.app-menu-popover > button,
.app-menu-recent button {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 9px;
  text-align: left;
}

.app-menu-popover > button:hover,
.app-menu-recent button:hover {
  background: var(--panel-subtle);
}
.app-menu-popover button > svg {
  flex: none;
  color: var(--muted);
}
.app-menu-separator {
  height: 1px;
  margin: 5px 3px;
  background: var(--border);
}
.app-menu-recent {
  display: grid;
  min-width: 0;
  border-top: 1px solid var(--border);
  margin-top: 5px;
  padding-top: 5px;
}
.app-menu-recent > strong {
  padding: 5px 9px 3px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-menu-recent button > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.app-menu-recent button b,
.app-menu-recent button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-menu-recent button b {
  font-size: 0.78rem;
}
.app-menu-recent button small {
  color: var(--muted);
  font-size: 0.65rem;
}

.global-context {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filename-input {
  min-width: 80px;
  max-width: 360px;
  width: min(36vw, 360px);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-weight: 650;
  outline: none;
  padding: 6px 8px;
}

.filename-input:focus {
  background: var(--panel-subtle);
}

.save-status {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.toolbar,
.global-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button,
.mode-button,
.global-command {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.icon-button:hover,
.mode-button:hover,
.global-command:hover {
  background: var(--panel-subtle);
}

.icon-button.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.global-toolbar .timeline-quick-new {
  color: var(--accent);
}

.global-command {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 0 10px;
}

.global-command.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.modebar {
  gap: 6px;
  padding: 5px 10px;
}

.mode-button {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
}

.mode-button.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.editor-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

.document-panel {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 0 10px;
}

.raw-editor {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: none;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.95rem;
  line-height: 1.65;
}

.wysiwyg-host {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  color: #172033;
}

:root.dark .wysiwyg-host {
  filter: invert(0.9) hue-rotate(180deg);
}

.wysiwyg-host > div {
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.wysiwyg-host > div > div:last-child,
.wysiwyg-host > div > div:last-child > div {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.wysiwyg-host > div > div:last-child > div > div:last-child {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

.wysiwyg-host [data-item-type="button"].--active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border)) !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

.wysiwyg-host [data-item-type="button"].--active svg {
  stroke-width: 2px;
}

.markdown-preview {
  height: 100%;
  overflow: auto;
  padding: 28px min(7vw, 72px);
  line-height: 1.68;
}

.markdown-preview > * {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  line-height: 1.25;
}

.markdown-preview h1 {
  margin-top: 0;
  font-size: 2.25rem;
}

.markdown-preview h2 {
  margin-top: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.markdown-preview a {
  color: var(--accent);
}

.markdown-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-align: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.markdown-preview pre {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.markdown-preview code {
  border-radius: 4px;
  background: var(--panel-subtle);
  padding: 0.12em 0.3em;
}

.markdown-preview pre code {
  background: transparent;
  padding: 0;
}

.markdown-preview table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-preview th,
.markdown-preview td {
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.markdown-preview blockquote {
  border-left: 4px solid var(--border);
  color: var(--muted);
  margin: 1.25rem auto;
  padding: 0.1rem 1rem;
}

.callout {
  --callout-color: #2563eb;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--callout-color);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.callout-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--callout-color);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.callout-body > :last-child {
  margin-bottom: 0;
}

.callout-note,
.callout-info,
.callout-todo {
  --callout-color: #2563eb;
  background: color-mix(in srgb, #2563eb 9%, var(--panel));
}

.callout-tip,
.callout-success {
  --callout-color: #059669;
  background: color-mix(in srgb, #059669 9%, var(--panel));
}

.callout-warning,
.callout-question {
  --callout-color: #d97706;
  background: color-mix(in srgb, #d97706 10%, var(--panel));
}

.callout-failure,
.callout-danger,
.callout-bug {
  --callout-color: #dc2626;
  background: color-mix(in srgb, #dc2626 8%, var(--panel));
}

.callout-example,
.callout-abstract,
.callout-quote {
  --callout-color: #7c3aed;
  background: color-mix(in srgb, #7c3aed 7%, var(--panel));
}

.mermaid-block {
  display: flex;
  justify-content: center;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.mermaid-block svg {
  max-width: 100%;
}

.workflow-file-view {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
}
.workflow-file-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 5px 8px;
}
.workflow-file-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 5px 9px;
  cursor: pointer;
}
.workflow-file-toolbar button.active {
  background: var(--hover);
  color: var(--text);
}
.workflow-file-preview {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 16px;
}
.workflow-file-preview .mermaid-block {
  min-height: 100%;
  align-items: center;
}
.workflow-file-source {
  min-height: 0;
  flex: 1;
}
.workflow-file-error {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--danger);
  text-align: center;
}
.workflow-file-error span {
  max-width: 640px;
  color: var(--muted);
}

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

.dashboard-shell {
  position: relative;
  display: block;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}

.dashboard-native-toolbar {
  position: relative;
  z-index: 120;
  display: flex;
  min-width: 0;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 6px 12px;
}
.dashboard-native-title,
.dashboard-native-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
}
.dashboard-native-title {
  position: relative;
  color: var(--muted);
}
.dashboard-native-title > button {
  display: inline-flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 4px;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-native-title > button:hover {
  color: var(--text);
}
.dashboard-native-title .home {
  color: var(--accent);
}
.dashboard-native-actions > button {
  display: inline-flex;
  height: 33px;
  min-width: 33px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 9px;
  font-size: 13px;
}
.dashboard-native-actions > button:hover,
.dashboard-native-actions > button.active {
  background: var(--panel-subtle);
  color: var(--text);
}
.dashboard-native-actions > button.add {
  color: var(--accent);
  font-weight: 650;
}
.dashboard-native-actions > button.add:hover {
  background: var(--accent-soft);
}
.dashboard-native-actions > button.danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}
.dashboard-native-actions > button:disabled {
  cursor: default;
  opacity: 0.3;
}
.dashboard-native-actions > span {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: var(--border);
}
.dashboard-switcher {
  position: absolute;
  z-index: 180;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  width: 224px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.24);
}
.dashboard-switcher > div {
  display: grid;
  max-height: 260px;
  overflow: auto;
  padding: 4px 0;
}
.dashboard-switcher button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 9px 11px;
  text-align: left;
  font-size: 13px;
}
.dashboard-switcher button:hover {
  background: var(--panel-subtle);
}
.dashboard-switcher button.active {
  color: var(--accent);
  font-weight: 650;
}
.dashboard-switcher button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-switcher button.create {
  border-top: 1px solid var(--border);
  color: var(--accent);
}
.dashboard-name-backdrop {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.5);
  padding: 16px;
}
.dashboard-name-dialog {
  width: min(380px, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgb(0 0 0 / 0.35);
}
.dashboard-name-dialog > header,
.dashboard-name-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
}
.dashboard-name-dialog > header {
  border-bottom: 1px solid var(--border);
}
.dashboard-name-dialog > header button {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.dashboard-name-dialog > div {
  padding: 14px;
}
.dashboard-name-dialog > div {
  display: grid;
  gap: 7px;
}
.dashboard-name-dialog > div small.error {
  color: var(--danger);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.dashboard-name-dialog input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: 0;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px;
}
.dashboard-name-dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.dashboard-name-dialog > footer {
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid var(--border);
}
.dashboard-name-dialog > footer button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
}
.dashboard-name-dialog > footer button.primary {
  background: var(--accent);
  color: white;
}

@media (max-width: 820px) {
  .dashboard-native-toolbar {
    gap: 4px;
    padding-inline: 7px;
  }
  .dashboard-native-title > button {
    max-width: 120px;
  }
  .dashboard-native-actions {
    gap: 1px;
  }
  .dashboard-native-actions > button {
    padding-inline: 5px;
  }
  .dashboard-native-actions > button.add span {
    display: none;
  }
  .dashboard-native-actions > span {
    margin-inline: 0;
  }
}

@media (max-width: 620px) {
  .dashboard-native-actions > button:nth-of-type(3),
  .dashboard-native-actions > button:nth-of-type(4) {
    display: none;
  }
  .dashboard-native-title > button {
    max-width: 90px;
  }
}

.dashboard-file-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 5px;
  border-right: 1px solid var(--border);
}
.dashboard-file-toolbar select {
  width: 150px;
  height: 33px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 0 7px;
  font-size: 13px;
}
.dashboard-file-toolbar .danger {
  color: #d75c5c;
}
.dashboard-raw-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--surface);
}
.dashboard-raw-editor > header {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.dashboard-raw-editor > header span {
  color: var(--text-muted);
  font-size: 10px;
}
.dashboard-raw-editor textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  background: #11151b;
  color: #d9e2ef;
  padding: 14px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
.dashboard-file-error {
  padding: 7px 10px;
  background: color-mix(in srgb, #d94f4f 13%, var(--surface));
  color: #e16a6a;
  font-size: 11px;
}
.dashboard-file-error.floating {
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, #d94f4f 45%, var(--border));
  border-radius: 6px;
  box-shadow: 0 6px 22px rgb(0 0 0 / 0.25);
}
.dashboard-file-error button {
  border: 0;
  background: transparent;
  color: inherit;
}

.dashboard-modal-backdrop,
.dashboard-settings-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  background: rgb(0 0 0 / 0.48);
}
.dashboard-modal-backdrop {
  align-items: center;
  justify-content: center;
}
.dashboard-widget-palette {
  width: min(560px, calc(100vw - 32px));
  max-height: 80vh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgb(0 0 0 / 0.35);
}
.dashboard-widget-palette > header,
.dashboard-widget-settings > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
}
.dashboard-widget-palette header button,
.dashboard-widget-settings header button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.dashboard-widget-palette > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  max-height: calc(80vh - 50px);
  padding: 12px;
}
.dashboard-widget-palette > div > button {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 14px;
  text-align: center;
}
.dashboard-widget-palette > div > button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
}
.dashboard-widget-palette button > span {
  display: grid;
  gap: 3px;
}
.dashboard-widget-palette small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.dashboard-settings-backdrop {
  justify-content: flex-end;
}
.dashboard-widget-settings {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(410px, 100vw);
  height: 100%;
  background: var(--surface);
  box-shadow: -12px 0 40px rgb(0 0 0 / 0.28);
}
.dashboard-widget-settings.base-widget-settings {
  width: min(580px, 100vw);
}
.dashboard-widget-settings.file-widget-settings {
  width: min(440px, 100vw);
}
.dashboard-widget-settings > header > div {
  display: grid;
  gap: 2px;
}
.widget-settings-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}
.widget-settings-heading > svg {
  color: var(--text-muted);
}
.dashboard-widget-settings > header small {
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-widget-settings-body {
  display: grid;
  align-content: start;
  gap: 11px;
  overflow: auto;
  padding: 13px;
}
.base-widget-settings .dashboard-widget-settings-body {
  gap: 16px;
  padding: 18px 24px;
}
.file-widget-settings .dashboard-widget-settings-body {
  gap: 18px;
  padding: 20px;
  font-size: 15px;
}
.file-widget-settings > header small {
  font-size: 12px;
}
.file-widget-settings .dashboard-widget-settings-body label {
  gap: 8px;
  font-size: 15px;
}
.file-widget-settings .dashboard-widget-settings-body label.check {
  padding: 11px 12px;
  color: var(--text);
}
.file-widget-settings .file-config-current {
  font-size: 13px;
}
.file-widget-settings .file-source-switch button {
  padding: 8px 13px;
  font-size: 14px;
}
.file-widget-settings .file-create-row input,
.file-widget-settings .file-create-row button {
  min-height: 40px;
  font-size: 14px;
}
.dashboard-widget-settings-body label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
}
.dashboard-widget-settings-body label.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 9px;
}
.dashboard-widget-settings-body input:not([type="checkbox"]),
.dashboard-widget-settings-body select,
.dashboard-widget-settings-body textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px;
  font: inherit;
}
.dashboard-widget-settings-body textarea {
  resize: vertical;
  font-family: ui-monospace, monospace;
}
.dashboard-widget-settings-body .error {
  color: #e26161;
}
.dashboard-widget-settings-body .widget-settings-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 7px;
}
.file-config-editor {
  display: grid;
  gap: 10px;
}
.settings-file-field {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 15px;
}
.settings-file-picker {
  position: relative;
  min-width: 0;
}
.settings-file-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px 11px;
  font-size: 14px;
  text-align: left;
}
.settings-file-picker-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
.settings-file-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-file-picker-popover {
  position: absolute;
  z-index: 30;
  inset: calc(100% + 5px) 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgb(0 0 0 / 0.3);
}
.settings-file-picker-search {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 9px;
}
.settings-file-picker-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.settings-file-picker-results {
  max-height: 280px;
  overflow: auto;
  padding: 5px;
}
.settings-file-picker-results button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 9px;
  font-size: 14px;
  text-align: left;
}
.settings-file-picker-results button:hover,
.settings-file-picker-results button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.settings-file-picker-results button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-file-picker-results p {
  margin: 0;
  color: var(--text-muted);
  padding: 18px 10px;
  text-align: center;
}
.base-config-editor {
  display: grid;
  gap: 10px;
}
.file-config-current {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 9px;
}
.file-config-current span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-config-current button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 2px;
}
.file-source-switch,
.timeline-mode-switch {
  display: inline-flex;
  justify-self: start;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  padding: 2px;
}
.file-source-switch button,
.timeline-mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
}
.file-source-switch button.active,
.timeline-mode-switch button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.file-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}
.file-create-row button {
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: white;
  padding: 0 10px;
}
.settings-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.workflow-card-mapping {
  display: grid;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  padding: 8px;
}
.workflow-card-mapping > strong {
  font-size: 10px;
}
.kanban-config-editor {
  display: grid;
  gap: 10px;
}
.kanban-config-current {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.kanban-config-current span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-config-current button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 2px;
}
.kanban-config-editor .kanban-save-definition {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: white;
  padding: 7px;
}
.kanban-save-status {
  justify-self: end;
  color: var(--text-muted);
  font-size: 8px;
}
.kanban-config-editor .kanban-file-column {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) repeat(3, auto);
}
.kanban-settings-columns {
  display: grid;
  gap: 7px;
}
.kanban-display-field,
.kanban-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 76px repeat(3, auto);
  gap: 5px;
}
.kanban-filter-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}
.kanban-display-field button,
.kanban-filter-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
}
.workspace-folder-picker {
  position: relative;
}
.workspace-folder-picker > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}
.workspace-folder-picker > div > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-muted);
}
.workspace-folder-picker > aside {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}
.workspace-folder-picker nav,
.workspace-folder-picker nav span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.workspace-folder-picker nav {
  padding: 7px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.workspace-folder-picker button {
  color: inherit;
}
.workspace-folder-picker nav button,
.workspace-folder-picker li button {
  border: 0;
  background: transparent;
}
.workspace-folder-picker ul {
  margin: 0;
  padding: 4px;
  list-style: none;
}
.workspace-folder-picker li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}
.workspace-folder-picker li button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px;
  text-align: left;
}
.workspace-folder-picker li button:first-child svg.selected {
  margin-left: auto;
}
.workspace-folder-picker aside > p {
  margin: 0;
  padding: 15px;
  color: var(--text-muted);
  text-align: center;
}
.dashboard-widget-settings > footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 13px;
  border-top: 1px solid var(--border);
}
.dashboard-widget-settings > footer button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
}
.dashboard-widget-settings > footer .danger {
  background: transparent;
  color: #dc6262;
}
.dashboard-widget-settings > footer .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

/* Settings use normal desktop text sizes; sub-12px text is reserved for no content. */
.dashboard-widget-settings > header strong {
  font-size: 15px;
}
.dashboard-widget-settings > header small {
  font-size: 12px;
}
.dashboard-widget-settings-body {
  font-size: 14px;
}
.dashboard-widget-settings-body label,
.base-widget-settings .dashboard-widget-settings-body label {
  font-size: 14px !important;
}
.dashboard-widget-settings-body input:not([type="checkbox"]),
.dashboard-widget-settings-body select,
.dashboard-widget-settings-body textarea,
.dashboard-widget-settings-body button {
  font-size: 14px !important;
}
.file-config-current,
.kanban-save-status,
.gemihub-base-auto,
.gemihub-base-section p,
.gemihub-base-empty {
  font-size: 12px !important;
}
.workflow-card-mapping > strong,
.gemihub-base-header > span,
.gemihub-base-field,
.gemihub-base-section-title > label,
.gemihub-base-check {
  font-size: 14px !important;
}
.gemihub-base-header > small,
.gemihub-base-filters select,
.gemihub-base-section-title select,
.gemihub-base-order > div > span,
.gemihub-base-add,
.gemihub-base-raw summary,
.gemihub-base-raw textarea {
  font-size: 12px !important;
}

.dashboard-widget-empty,
.dashboard-widget-error {
  padding: 14px;
  color: var(--text-muted);
  font-size: 11px;
}
.dashboard-widget-error {
  color: #dc6262;
}
.dashboard-web-widget {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
}
.dashboard-web-widget.with-header {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.dashboard-web-widget > header,
.dashboard-base-widget > header,
.dashboard-memo-list-widget > header,
.dashboard-secret-widget > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-web-widget > header {
  justify-content: flex-start;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.dashboard-web-widget > header > svg:first-child {
  flex: none;
  color: #8b5cf6;
}
.dashboard-web-widget > header span {
  flex: 1;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-web-widget > header button {
  display: inline-flex;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 2px;
}
.dashboard-web-widget button,
.dashboard-base-widget button,
.dashboard-memo-list-widget button,
.dashboard-secret-widget button,
.dashboard-timeline-widget button,
.dashboard-kanban-widget button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
}
.dashboard-web-frame {
  position: relative;
  min-height: 0;
}
.dashboard-web-frame > .dashboard-widget-loading {
  position: absolute;
  inset: 0;
  align-items: center;
  background: var(--surface);
}
.dashboard-web-widget iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.dashboard-web-blocked {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  padding: 14px;
  text-align: center;
}
.dashboard-web-blocked > svg {
  color: color-mix(in srgb, var(--text-muted) 42%, transparent);
}
.dashboard-web-blocked button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: white;
  padding: 7px 10px;
  font-size: 9px;
}
.dashboard-web-widget > footer {
  overflow: hidden;
  border-top: 1px solid var(--border);
  color: var(--accent);
  padding: 4px 7px;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-memo-list-widget,
.dashboard-secret-widget,
.dashboard-timeline-widget,
.dashboard-kanban-widget,
.dashboard-base-widget {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
}
.dashboard-memo-list-widget,
.dashboard-kanban-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dashboard-secret-widget header label {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 5px;
}
.dashboard-memo-list-widget > header {
  justify-content: flex-start;
  padding: 6px 8px;
  background: var(--surface);
}
.dashboard-memo-list-widget > header > svg {
  flex: none;
}
.dashboard-memo-list-widget header input,
.dashboard-secret-widget header input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
}
.dashboard-memo-list-widget .memo-list-rows {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.dashboard-memo-list-widget .memo-list-rows > button {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 8px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  padding: 6px 8px;
  text-align: left;
}
.dashboard-memo-list-widget .memo-list-rows > button:hover {
  background: var(--surface-raised);
}
.dashboard-memo-list-widget .memo-list-rows > button > svg {
  flex: none;
  margin-top: 2px;
  color: var(--text-muted);
}
.dashboard-memo-list-widget button span {
  display: grid;
  flex: 1;
  min-width: 0;
}
.dashboard-memo-list-widget button strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-memo-list-widget button small,
.dashboard-memo-list-widget button em {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-memo-list-widget button time {
  flex: none;
  color: var(--text-muted);
  font-size: 8px;
}
.dashboard-widget-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
  color: var(--text-muted);
}
.dashboard-widget-loading.centered {
  height: 100%;
  align-items: center;
}
.dashboard-widget-loading .spin {
  animation: workflow-spin 1s linear infinite;
}
.dashboard-widget-empty.compact {
  padding: 12px;
}
.memo-list-pager {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-top: 1px solid var(--border);
  padding: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.memo-list-pager button {
  display: inline-flex;
  border: 0;
  background: transparent;
  padding: 2px;
}

.dashboard-timeline-widget {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}
.timeline-feed {
  overflow-anchor: none;
}
.timeline-toolbar {
  z-index: 3;
  display: flex;
  flex: none;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
}
.timeline-toolbar strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-toolbar select {
  max-width: 120px;
  min-width: 76px;
  height: 23px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 2px 5px;
  font-size: 9px;
}
.timeline-toolbar button {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 3px;
}
.timeline-toolbar button.active {
  color: var(--accent);
}
.timeline-toolbar button i {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-filters {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px;
  border-bottom: 1px solid var(--border);
}
.timeline-filters input,
.timeline-filters select {
  min-width: 100px;
  height: 29px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 4px 6px;
  font-size: 9px;
}
.timeline-filters label.search {
  position: relative;
  display: flex;
  min-width: 120px;
  flex: 1;
  align-items: center;
}
.timeline-filters label.search svg {
  position: absolute;
  left: 7px;
  color: var(--text-muted);
}
.timeline-filters label.search input {
  padding-left: 25px;
}
.timeline-filters .timeline-pinned-only {
  display: flex;
  height: 29px;
  flex: none;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  padding: 0 7px;
  font-size: 9px;
}
.timeline-filters .timeline-pinned-only input {
  min-width: 0;
  height: auto;
  flex: none;
}
.timeline-feed {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}
.timeline-feed article {
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 10px;
}
.timeline-feed article.pinned {
  border-left: 2px solid var(--accent);
}
.timeline-feed article > header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 8px;
}
.timeline-feed article > header code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-feed article > header div {
  display: flex;
  gap: 3px;
  opacity: .6;
}
.timeline-feed article:hover > header div {
  opacity: 1;
}
.timeline-feed article > header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 2px 4px;
  font-size: 8px;
}
.timeline-feed article > header button:hover,
.timeline-feed article > header button.active {
  color: var(--accent);
}
.timeline-feed article > details > summary {
  margin: 5px 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 9px;
}
.timeline-post-toggle {
  margin-top: 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--accent);
  padding: 4px 7px;
  font-size: 9px;
}
.timeline-post-toggle:hover {
  background: var(--accent-soft);
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.timeline-tags button {
  border: 0;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 5px;
  font-size: 9px;
}
.timeline-load-more {
  display: flex;
  width: max-content;
  margin: 6px auto;
  justify-self: center;
  padding: 5px 12px;
}
.timeline-inline-editor {
  display: grid;
  gap: 6px;
}
.timeline-inline-editor textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  font: 10px/1.5 ui-monospace, monospace;
}
.timeline-inline-editor > div,
.timeline-inline-editor > div > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.timeline-inline-editor button {
  border: 0;
  background: transparent;
  padding: 5px 8px;
}
.timeline-inline-editor button.primary {
  border-radius: 5px;
  background: var(--accent);
  color: white;
}
.timeline-composer-shell {
  flex: none;
  border-top: 1px solid var(--border);
  padding: 7px;
}
.timeline-composer-shell:not(.open) {
  display: flex;
  justify-content: flex-end;
}
.timeline-new-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 7px rgb(0 0 0 / 18%);
  padding: 0;
  transition: width 140ms ease;
}
.timeline-new-button span {
  display: none;
  white-space: nowrap;
}
.timeline-new-button:hover {
  width: 92px;
  gap: 5px;
  padding-inline: 9px;
}
.timeline-new-button:hover span {
  display: inline;
}
.timeline-composer {
  display: grid;
  gap: 7px;
}
.timeline-composer-mode {
  display: flex;
  justify-content: flex-end;
}
.timeline-composer-mode span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--accent);
  padding: 3px 7px;
  font-size: 9px;
}
.timeline-composer-editor {
  min-width: 0;
  min-height: 72px;
}
.timeline-composer-editor textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 7px;
  font-size: 10px;
}
.timeline-composer-editor .wysiwyg-host {
  min-height: 72px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  padding: 4px;
  font-size: 10px;
}
.timeline-composer-actions,
.timeline-composer-actions > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.timeline-composer-actions label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
}
.timeline-composer-actions label input {
  display: none;
}
.timeline-composer-actions button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 8px;
}
.timeline-composer-actions button.primary {
  border-radius: 5px;
  background: var(--accent);
  color: white;
}
.timeline-attachments {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}
.timeline-attachments > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  padding: 3px 5px;
  font-size: 8px;
}
.timeline-attachments button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}
.timeline-ai-form {
  display: grid;
  gap: 10px;
}
.timeline-ai-form label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.timeline-ai-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px;
}
.timeline-ai-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.timeline-ai-form button {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
}
.timeline-ai-form button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.dashboard-widget-empty.centered {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.dashboard-widget-empty.centered.icon {
  flex-direction: column;
  gap: 7px;
}

.kanban-board-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.kanban-board-header > strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-board-header select {
  max-width: 150px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 4px 6px;
  font-size: 9px;
}
.kanban-board-header > button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  border-color: var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 5px 8px;
  font-size: 9px;
}
.dashboard-inline-error {
  min-width: 0;
  overflow: hidden;
  color: var(--danger);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-columns {
  display: flex;
  width: 100%;
  flex: 1;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  padding: 0 7px 7px;
}
.kanban-filter {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9px;
}
.kanban-filter select {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 9px;
}
.kanban-columns > section {
  --kanban-column-accent: #3b82f6;
  display: flex;
  flex-direction: column;
  width: auto;
  min-width: 220px;
  flex: 1 0 220px;
  min-height: 100px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-top: 3px solid currentColor;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 75%, transparent);
  color: var(--kanban-column-accent);
  padding: 5px;
}
.kanban-columns > section > header {
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid currentColor;
  padding: 3px 4px 6px;
}
.kanban-columns > section > header strong {
  flex: 1;
}
.kanban-columns > section > header span {
  min-width: 19px;
  border-radius: 999px;
  background: var(--kanban-column-accent);
  color: white;
  padding: 2px 5px;
  text-align: center;
  font-size: 8px;
}
.kanban-columns > section > button {
  display: grid;
  width: 100%;
  gap: 3px;
  margin-top: 5px;
  border-left: 3px solid currentColor;
  background: var(--surface);
  padding: 7px;
  text-align: left;
  cursor: grab;
}
.kanban-columns > section > button strong {
  color: var(--text);
}
.kanban-columns > section > button small {
  color: var(--text-muted);
}
.kanban-columns > section > button.dragging {
  opacity: .5;
}
.kanban-columns > section > button.drop-before {
  box-shadow: 0 -2px 0 var(--accent);
}
.kanban-columns > section > button.drop-after {
  box-shadow: 0 2px 0 var(--accent);
}
.kanban-column-drop-zone {
  flex: 1 0 24px;
  min-height: 24px;
  margin-top: 5px;
  border: 1px dashed transparent;
  border-radius: 5px;
}
.kanban-columns > section > header + .kanban-column-drop-zone {
  min-height: 44px;
}
.kanban-column-drop-zone:hover {
  border-color: color-mix(in srgb, var(--kanban-column-accent) 55%,
    transparent);
  background: color-mix(in srgb, var(--kanban-column-accent) 8%, transparent);
}
.kanban-columns > section.kanban-accent-1 {
  --kanban-column-accent: #d97706;
}
.kanban-columns > section.kanban-accent-2 {
  --kanban-column-accent: #059669;
}
.kanban-columns > section.kanban-accent-3 {
  --kanban-column-accent: #7c3aed;
}
.kanban-columns > section.kanban-accent-4 {
  --kanban-column-accent: #0891b2;
}
.kanban-columns > section.kanban-accent-5 {
  --kanban-column-accent: #db2777;
}
.kanban-columns > section.kanban-accent-6 {
  --kanban-column-accent: #ca8a04;
}
.kanban-columns > section.kanban-accent-7 {
  --kanban-column-accent: #dc2626;
}
.kanban-new-card-backdrop {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 22%);
  padding: 12px;
  backdrop-filter: blur(1px);
}
.kanban-new-card-backdrop form {
  display: grid;
  width: min(320px, 100%);
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgb(0 0 0 / 28%);
  padding: 12px;
}
.kanban-new-card-backdrop form > header,
.kanban-new-card-backdrop form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-new-card-backdrop form > header button {
  border: 0;
  background: transparent;
}
.kanban-new-card-backdrop form > label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.kanban-new-card-backdrop input,
.kanban-new-card-backdrop select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px;
}
.kanban-new-card-backdrop form > footer {
  justify-content: flex-end;
  gap: 6px;
}
.kanban-new-card-backdrop form > footer button {
  padding: 6px 10px;
}
.kanban-new-card-backdrop form > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.widget-dialog-backdrop {
  position: fixed;
  z-index: 21000;
  inset: 0;
  background: rgb(0 0 0 / 52%);
}
.widget-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(512px, calc(100vw - 32px));
  height: min(608px, calc(100vh - 32px));
  min-width: min(320px, calc(100vw - 16px));
  min-height: 280px;
  overflow: hidden;
  resize: both;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 20px 65px rgb(0 0 0 / 42%);
}
.widget-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  cursor: move;
  padding: 11px 14px;
  touch-action: none;
  user-select: none;
}
.widget-dialog > header button {
  display: inline-flex;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  padding: 3px;
}
.widget-dialog > header button:hover {
  background: var(--surface-raised);
  color: var(--text);
}
.widget-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.dashboard-secret-widget {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dashboard-secret-widget > header {
  flex: none;
}
.dashboard-secret-widget > header > span {
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-secret-widget > header button.primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  padding: 5px 8px;
}
.secret-folder-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 65%, var(--surface));
  color: var(--text-muted);
  padding: 5px 9px;
  font-size: 11px;
}
.secret-folder-bar > svg {
  flex: none;
  color: #d69b29;
}
.secret-folder-bar > span {
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-list {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.secret-list > div[role="button"] {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  padding: 4px 9px;
}
.secret-list > div[role="button"]:hover {
  background: var(--surface-raised);
}
.secret-group {
  border-bottom: 1px solid color-mix(in srgb, #d69b29 28%, var(--border));
}
.secret-group > button {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-left: 3px solid #d69b29;
  border-radius: 0;
  background: color-mix(in srgb, #d69b29 9%, var(--surface));
  color: #9b6a12;
  padding: 6px 9px;
  text-align: left;
}
.secret-group > button > svg {
  flex: none;
}
.secret-group > button > strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-group > button > span {
  min-width: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, #d69b29 22%, var(--surface));
  padding: 2px 5px;
  text-align: center;
  font-size: 8px;
}
.secret-group > div {
  margin-left: 17px;
  border-left: 2px solid color-mix(in srgb, #d69b29 24%, var(--border));
}
.secret-group > div > div[role="button"] {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  padding: 4px 9px;
}
.secret-group > div > div[role="button"]:hover {
  background: var(--surface-raised);
}
.secret-group > div > div[role="button"] > svg {
  flex: none;
  color: #d69b29;
}
.secret-group > div > div[role="button"] > span {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
}
.secret-group > div > div[role="button"] em,
.secret-group > div > div[role="button"] small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-group > div > div[role="button"] > button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  opacity: 0;
  padding: 4px;
}
.secret-group > div > div[role="button"]:hover > button {
  opacity: 1;
}
.secret-list > div[role="button"] > svg {
  flex: none;
  color: #d69b29;
}
.secret-list > div[role="button"] > span {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
}
.secret-list > div[role="button"] strong {
  font-size: 12px;
  line-height: 1.25;
}
.secret-list > div[role="button"] em,
.secret-list > div[role="button"] small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-list .secret-entry-details {
  display: block;
  line-height: 1.25;
}
.secret-list > div[role="button"] > button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  opacity: 0;
  padding: 4px;
}
.secret-list > div[role="button"]:hover > button,
.secret-list > div[role="button"] > button:focus-visible {
  opacity: 1;
}
.secret-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}
.widget-dialog.secret-dialog > header {
  font-size: 14px;
}
.encrypted-file-modal-backdrop {
  position: fixed;
  z-index: 1900;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 58%);
}
.encrypted-file-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgb(0 0 0 / 48%);
}
.encrypted-file-modal > header,
.encrypted-file-modal > footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-color: var(--border);
}
.encrypted-file-modal > header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.encrypted-file-modal > header span,
.encrypted-file-modal > footer button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.encrypted-file-modal > header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.encrypted-file-modal > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.encrypted-file-modal > footer small {
  margin-right: auto;
  color: var(--text-muted);
}
.encrypted-file-unlock {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, calc(100% - 32px));
}
.encrypted-file-unlock input {
  width: 100%;
}
.encrypted-file-editor {
  min-height: 0;
  overflow: auto;
}
.encrypted-file-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 420px;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 16px;
  font-family: var(--font-mono);
}
.encrypted-file-editor > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}
.encrypted-file-editor > audio,
.encrypted-file-editor > video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 32px auto;
}
.dashboard-media-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
}
.dashboard-media-frame audio,
.dashboard-media-frame video {
  max-width: 100%;
  max-height: 100%;
}
.encrypted-file-editor > iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.encrypted-file-editor .wysiwyg-host {
  min-height: 100%;
  padding: 18px;
}
.encrypted-file-error {
  margin: 0;
  padding: 7px 14px;
}
.file-tree-context-menu {
  position: fixed;
  z-index: 1800;
  min-width: 180px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 10px 35px rgb(0 0 0 / 35%);
}
.file-tree-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}
.file-tree-context-menu button:hover {
  background: var(--surface-raised);
}
.file-lifecycle-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 20px 70px rgb(0 0 0 / 45%);
}
.file-lifecycle-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.file-lifecycle-dialog > header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.file-lifecycle-dialog > div {
  max-height: 560px;
  overflow: auto;
  padding: 10px;
}
.file-lifecycle-dialog article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px;
  border-bottom: 1px solid var(--border);
}
.file-lifecycle-dialog article span {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}
.file-lifecycle-dialog article small {
  color: var(--text-muted);
}
.file-lifecycle-dialog article button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.workspace-move-dialog {
  display: grid;
  width: min(500px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgb(0 0 0 / 35%);
}
.workspace-move-dialog > header,
.workspace-move-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.workspace-move-dialog > header {
  border-bottom: 1px solid var(--border);
}
.workspace-move-dialog > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.workspace-move-dialog > header button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.workspace-move-dialog > div {
  display: grid;
  gap: 11px;
  padding: 14px 12px;
}
.workspace-move-dialog label:not(.check) {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.workspace-move-dialog input,
.workspace-move-dialog select {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px;
}
.workspace-move-dialog input:disabled {
  opacity: .72;
}
.workspace-move-dialog label.check {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workspace-move-dialog label.check input {
  width: auto;
}
.workspace-move-dialog small {
  color: var(--text-muted);
}
.workspace-move-dialog > footer button {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px 11px;
}
.workspace-move-dialog > footer button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.secret-dialog-form {
  display: grid;
  gap: 11px;
}
.secret-create-kind {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}
.secret-create-kind legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.secret-create-kind label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  font-size: 13px;
}
.secret-dialog-form .secret-create-kind input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.secret-dialog-form > label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.secret-dialog-form label > small,
.secret-dialog-form .hint {
  margin: 0;
  color: #b88422;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
}
.secret-dialog-form input,
.secret-dialog-form textarea,
.secret-dialog-view textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px;
  font-size: 14px;
}
.secret-file-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: 0 10px;
  transition: border-color .15s ease, box-shadow .15s ease,
    background .15s ease;
}
.secret-file-select:focus-within {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.secret-file-select select {
  width: 100%;
  min-width: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.secret-file-select select:invalid {
  color: var(--text-muted);
}
.secret-file-select select option {
  background: var(--panel);
  color: var(--text);
}
.secret-file-select > svg:last-child {
  pointer-events: none;
}
.secret-dialog-form textarea,
.secret-dialog-view textarea {
  resize: vertical;
  font-family: ui-monospace, monospace;
}
.secret-dialog-form dl {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  padding: 8px;
}
.secret-dialog-form dl > div {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 2fr;
  gap: 8px;
  font-size: 9px;
}
.secret-dialog-form dt {
  color: var(--text-muted);
  font-weight: 600;
}
.secret-dialog-form dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.secret-dialog-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.secret-dialog-form button,
.secret-dialog-view button,
.secret-metadata-editor button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
}
.secret-dialog-form button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.secret-dialog-unlocking {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.secret-metadata-editor {
  display: grid;
  gap: 5px;
}
.secret-metadata-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
}
.secret-metadata-editor > header button {
  border: 0;
  color: var(--accent);
  padding: 2px;
}
.secret-metadata-editor > div {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) auto;
  gap: 5px;
}
.secret-metadata-editor > div button {
  border: 0;
  color: var(--text-muted);
  padding: 4px;
}
.secret-dialog-view {
  display: grid;
  gap: 10px;
}
.secret-dialog-view > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.secret-dialog-view > header span {
  display: flex;
  gap: 8px;
}
.secret-dialog-view > header button {
  border: 0;
  color: var(--accent);
  padding: 2px;
}
.base-ai-dialog {
  display: grid;
  gap: 10px;
}
.base-ai-dialog > label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
}
.base-ai-dialog textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px;
}
.base-ai-dialog > footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.base-ai-dialog button {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
}
.base-ai-dialog button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}
.kanban-card-modal-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  background: rgb(0 0 0 / 55%);
}
.kanban-card-modal-backdrop.calendar-link-preview-backdrop {
  z-index: 1400;
}
/* wysimark-lite renders toolbar menus and their close mask as body portals.
 * Raise those portal siblings above this modal while its editor is active. */
body.kanban-card-wysiwyg-open > div:not(#root):not(.kanban-card-modal-backdrop) {
  z-index: 2100 !important;
}
.workspace-file-picker-backdrop {
  position: fixed;
  z-index: 3200;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 58%);
  padding: 16px;
}
.workspace-file-picker {
  display: grid;
  width: min(680px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 32px));
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgb(0 0 0 / 45%);
}
.workspace-file-picker > header,
.workspace-file-picker > label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.workspace-file-picker > header strong {
  flex: 1;
}
.workspace-file-picker button {
  color: var(--text);
}
.workspace-file-picker > header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
}
.workspace-file-picker > label input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.workspace-file-picker > div {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
  padding: 7px;
}
.workspace-file-picker > div > button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 8px;
  text-align: left;
}
.workspace-file-picker > div > button:hover {
  background: var(--surface-raised);
}
.workspace-file-picker > div > button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-file-picker > div > span {
  margin: auto;
  color: var(--text-muted);
}
.kanban-card-modal {
  position: fixed;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: min(420px, calc(100vw - 16px));
  min-height: min(320px, calc(100vh - 16px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgb(0 0 0 / 42%);
}
.kanban-card-modal > header {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  cursor: move;
  padding: 9px 11px;
  touch-action: none;
  user-select: none;
}
.kanban-card-modal > header > strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card-modal button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 29px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
}
.kanban-card-modal button:hover,
.kanban-card-modal button.active {
  border-color: var(--accent);
  color: var(--accent);
}
.kanban-card-modal button:disabled {
  opacity: 0.45;
}
.kanban-card-modal-modes {
  display: flex;
  gap: 3px;
}
.kanban-card-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}
.kanban-card-modal-body > textarea {
  width: 100%;
  height: 100%;
  min-height: 360px;
  resize: none;
  border: 0;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.kanban-card-html-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}
.kanban-card-modal-body .wysiwyg-host {
  height: 100%;
  min-height: 100%;
}
.kanban-card-modal > footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-top: 1px solid var(--border);
}
.kanban-card-modal > footer > span {
  flex: 1;
  color: var(--danger);
  font-size: 10px;
}
.kanban-card-modal > footer button {
  padding: 0 10px;
}
.kanban-card-modal-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  min-height: 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 45%, var(--text-muted) 46%,
    var(--text-muted) 53%, transparent 54%, transparent 65%, var(--text-muted)
    66%, var(--text-muted) 73%, transparent 74%) !important;
  opacity: .65;
  padding: 0;
  touch-action: none;
}
body.resizing-modal {
  cursor: move;
  user-select: none;
}

.dashboard-base-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dashboard-base-widget > header select {
  min-width: 0;
  max-width: 160px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
}
.dashboard-base-widget > header > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-base-widget > header > div {
  display: flex;
  flex: none;
  gap: 2px;
}
.dashboard-base-widget > header > div button {
  position: relative;
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 3px;
}
.dashboard-base-widget > header > div button:hover,
.dashboard-base-widget > header > div button.active {
  color: var(--accent);
}
.base-control-active-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 6px;
  border: 1px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
}
.base-view-header label {
  display: flex;
  align-items: center;
  min-width: 70px;
  flex: 1;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
}
.base-view-header label input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 9px;
}
.base-control-scrim {
  position: absolute;
  z-index: 7;
  inset: 0;
  border: 0 !important;
  background: transparent !important;
}
.base-view-popover {
  position: absolute;
  z-index: 8;
  top: 34px;
  right: 7px;
  display: grid;
  width: min(300px, calc(100% - 14px));
  max-height: calc(100% - 42px);
  gap: 7px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 25px rgb(0 0 0 / 25%);
  padding: 9px;
}
.base-view-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.base-view-popover > header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
}
.base-view-popover > label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 9px;
}
.base-view-popover > label.base-search-control {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  padding: 2px 6px;
}
.base-view-popover > label.base-search-control > svg {
  flex: none;
}
.base-view-popover > label.base-search-control > input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 5px 1px;
}
.base-view-popover > label.base-search-control > button {
  display: inline-flex;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 2px;
}
.base-view-popover input,
.base-view-popover select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 6px;
  font-size: 9px;
}
.base-sort-options {
  display: grid;
  max-height: 240px;
  overflow-y: auto;
}
.base-sort-options button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  padding: 5px 7px;
  text-align: left;
  font-size: 9px;
}
.base-sort-options button:hover,
.base-sort-options button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.base-table,
.dashboard-workflow-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-width: 100%;
}
.base-table table,
.dashboard-workflow-table table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}
.base-table th,
.base-table td,
.dashboard-workflow-table th,
.dashboard-workflow-table td {
  max-width: 240px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 5px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.base-table th,
.dashboard-workflow-table th {
  position: sticky;
  top: 0;
  background: var(--surface-raised);
}
.base-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.base-table td input {
  width: 100%;
  min-width: 80px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 3px;
  font-size: inherit;
}
.base-cards,
.dashboard-workflow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 7px;
}
.base-cards > button,
.base-cards > section > button,
.dashboard-workflow-cards > article {
  display: grid;
  gap: 3px;
  padding: 7px;
  text-align: left;
}
.base-cards > section {
  display: grid;
  min-width: 0;
}
.base-cards > section > button {
  width: 100%;
}
.base-cards small {
  color: var(--text-muted);
}
.base-list {
  display: grid;
}
.base-list > button,
.base-list > section > button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 7px;
  text-align: left;
}
.base-list span {
  color: var(--text-muted);
}
.base-group-start > h4 {
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 600;
}
.base-group-row > th {
  position: static;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}
.base-table tfoot {
  position: sticky;
  bottom: 0;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 9px;
}
.base-file-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.base-file-view > header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 5px 7px;
}
.base-file-view > header > span {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.base-file-view > header select {
  max-width: 160px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 4px;
  font-size: 10px;
}
.base-file-view > header > div {
  display: flex;
  gap: 3px;
}
.base-file-view > header button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 6px;
  font-size: 10px;
}
.base-file-view > header button:hover,
.base-file-view > header button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.base-file-view > textarea {
  flex: 1;
  min-height: 0;
}
.base-file-result {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.base-file-result tbody tr {
  cursor: pointer;
}
.base-renderer-empty {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}
.gemihub-base-groups {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.gemihub-base-groups > section + section {
  margin-top: 14px;
}
.gemihub-base-group-header {
  display: grid;
  gap: 5px;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
}
.gemihub-base-group-header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.gemihub-base-group-header strong span {
  color: var(--text-muted);
  font-weight: 400;
}
.gemihub-base-group-header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gemihub-base-group-header > div span {
  border-radius: 4px;
  background: var(--surface-raised);
  padding: 3px 6px;
}
.gemihub-base-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.gemihub-base-table > section + section {
  margin-top: 14px;
}
.gemihub-base-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.gemihub-base-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}
.gemihub-base-table td {
  max-width: 256px;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text);
  padding: 7px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gemihub-base-table.row-low td,
.gemihub-base-table.row-small td,
.gemihub-base-table.row-compact td {
  padding-block: 3px;
}
.gemihub-base-table.row-high td,
.gemihub-base-table.row-large td,
.gemihub-base-table.row-tall td {
  padding-block: 11px;
}
.gemihub-base-table tbody tr {
  cursor: pointer;
}
.gemihub-base-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.gemihub-base-table tbody tr:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.gemihub-base-table tfoot {
  position: sticky;
  bottom: 0;
  background: var(--surface-raised);
}
.gemihub-base-table tfoot td {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.gemihub-base-table tfoot td span {
  color: var(--text-muted);
  font-weight: 400;
}
.gemihub-base-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.gemihub-base-cards.size-small {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
}
.gemihub-base-cards.size-large {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.gemihub-base-cards > button {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
  color: var(--text);
  padding: 10px;
  text-align: left;
}
.gemihub-base-card-image {
  width: calc(100% + 20px);
  height: 150px;
  margin: -10px -10px 8px;
  background: var(--panel-subtle);
}
.gemihub-base-cards > button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 3px 10px rgb(0 0 0 / 10%);
}
.gemihub-base-cards strong,
.gemihub-base-cards small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gemihub-base-cards strong {
  font-size: 13px;
}
.gemihub-base-cards small {
  color: var(--text-muted);
  font-size: 12px;
}
.gemihub-base-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gemihub-base-list button {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  padding: 5px 7px;
  text-align: left;
}
.gemihub-base-list button:hover {
  background: var(--surface-raised);
  color: var(--accent);
}
.gemihub-base-list button > span:last-child {
  color: var(--text-muted);
  font-size: 12px;
}
.gemihub-base-marker {
  min-width: 18px;
  color: var(--text-muted);
}
.base-visual-editor {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.kanban-file-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.kanban-file-view > header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 7px;
}
.kanban-file-view > header > span {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.structured-file-modes {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.structured-file-modes button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 7px;
  font-size: 11px;
}
.structured-file-modes button:last-child {
  border-right: 0;
}
.structured-file-modes button:hover,
.structured-file-modes button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.structured-file-modes button:disabled {
  opacity: .4;
}
.kanban-file-display {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.kanban-file-display > .dashboard-kanban-widget {
  flex: 1;
}
.kanban-file-edit-panel {
  position: absolute;
  z-index: 20;
  inset: 0 0 0 auto;
  display: flex;
  width: min(420px, 100%);
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -12px 0 35px rgb(0 0 0 / 18%);
}
.kanban-file-edit-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 11px 13px;
}
.kanban-file-edit-panel > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.kanban-file-edit-panel > header button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}
.kanban-file-edit-panel > div {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 13px;
}
.kanban-file-edit-panel label {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.kanban-file-edit-panel input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px 8px;
  font-size: 12px;
}
.kanban-file-edit-panel section {
  display: grid;
  gap: 7px;
}
.kanban-file-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
}
.kanban-file-column button,
.kanban-file-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 7px;
}
.kanban-file-column button:hover {
  color: var(--danger);
}
.kanban-file-add {
  width: max-content;
  color: var(--accent);
}
.kanban-file-check {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
}
.kanban-file-check input {
  width: auto;
}
.base-config-section {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}
.base-config-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.base-config-section button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  padding: 5px 7px;
  font-size: 10px;
}
.base-config-section button:hover {
  background: var(--surface-raised);
}
.base-config-section button.danger {
  width: max-content;
  color: var(--danger);
}
.base-map-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(160px, 2fr) auto;
  gap: 5px;
}
.base-map-row input,
.base-view-fields input,
.base-view-fields select,
.base-view-fields textarea,
.base-yaml-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 6px;
  font-size: 11px;
}
.base-yaml-field {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
}
.base-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.base-view-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.base-view-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.base-view-fields > label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
}
.base-view-fields > .wide {
  grid-column: 1 / -1;
}
.base-view-editor > p {
  color: var(--text-muted);
  font-size: 11px;
}
.gemihub-base-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gemihub-base-auto {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}
.gemihub-base-header > span {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gemihub-base-header > span svg {
  flex: none;
  color: var(--text-muted);
}
.gemihub-base-header > small {
  flex: none;
  color: var(--text-muted);
  font-size: 10px;
}
.gemihub-base-header .widget-settings-ai {
  flex: none;
  padding: 5px 8px;
  color: #7e57c2;
}
.gemihub-base-editor {
  display: grid;
  gap: 12px;
}
.gemihub-base-field {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.gemihub-base-field > span,
.gemihub-base-section > label,
.gemihub-base-section-title > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.gemihub-base-field input,
.gemihub-base-field select,
.gemihub-base-section > select,
.gemihub-base-section-title select,
.gemihub-base-order input,
.gemihub-base-filters input,
.gemihub-base-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 6px 8px;
  font-size: 11px;
}
.gemihub-base-section {
  display: grid;
  gap: 5px;
}
.gemihub-base-section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
}
.gemihub-base-section p.warning {
  border: 1px solid color-mix(in srgb, #d69b29 45%, var(--border));
  border-radius: 5px;
  background: color-mix(in srgb, #d69b29 10%, var(--surface));
  color: #b88422;
  padding: 6px;
}
.gemihub-base-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gemihub-base-section-title select {
  width: auto;
  padding: 3px 6px;
  font-size: 10px;
}
.gemihub-base-order {
  display: grid;
  gap: 4px;
}
.gemihub-base-order > div {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 6px;
}
.gemihub-base-order > div.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.gemihub-base-order > div > svg {
  flex: none;
  cursor: move;
  color: var(--text-muted);
}
.gemihub-base-order > div > span {
  width: 112px;
  flex: none;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gemihub-base-order > div > input {
  flex: 1;
  padding: 5px 7px;
}
.gemihub-base-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.gemihub-base-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 11px;
}
.gemihub-base-filters {
  display: grid;
  gap: 5px;
}
.gemihub-base-filters > div {
  display: grid;
  grid-template-columns: minmax(90px, .9fr) minmax(75px, .7fr) minmax(90px,
    1.25fr) auto;
  align-items: center;
  gap: 5px;
}
.gemihub-base-filters > div.predicate {
  grid-template-columns: minmax(110px, .9fr) minmax(160px, 1.6fr) auto;
}
.gemihub-base-remove {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 4px;
}
.gemihub-base-remove:hover {
  color: var(--danger);
}
.gemihub-base-add {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 3px 0;
  font-size: 10px;
}
.gemihub-base-raw summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
}
.gemihub-base-raw textarea {
  width: 100%;
  margin-top: 5px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 7px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.gemihub-base-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.dashboard-secret-widget article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px;
  border-bottom: 1px solid var(--border);
}
.dashboard-secret-widget article > div:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dashboard-secret-widget article span {
  display: grid;
  min-width: 0;
}
.dashboard-secret-widget article em {
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
}
.dashboard-secret-widget article small b {
  color: var(--text);
  font-weight: 600;
}
.dashboard-secret-widget article small {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.secret-value {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.secret-value code {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-unknown-widget {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: var(--text-muted);
  padding: 12px;
  font-size: 10px;
}
.dashboard-unknown-widget svg {
  color: color-mix(in srgb, var(--text-muted) 45%, transparent);
}

@media (max-width: 900px) {
  .dashboard-file-toolbar select {
    width: 105px;
  }
  .dashboard-file-toolbar .icon-button:nth-of-type(3),
  .dashboard-file-toolbar .icon-button:nth-of-type(4) {
    display: none;
  }
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 0 12px;
}

.dashboard-title,
.dashboard-actions,
.dashboard-command,
.dashboard-widget-header,
.dashboard-widget-tools {
  display: flex;
  align-items: center;
}

.dashboard-title {
  min-width: 0;
  gap: 8px;
  font-weight: 700;
}

.dashboard-actions {
  gap: 6px;
}

.dashboard-command {
  height: 30px;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
}

.dashboard-command.active,
.dashboard-command:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dashboard-scroll {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.dashboard-grid {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 100%;
}

.dashboard-empty-state {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
}
.dashboard-empty-state > svg {
  color: color-mix(in srgb, var(--muted) 48%, transparent);
}
.dashboard-empty-state p {
  margin: 0;
  font-size: 12px;
}
.dashboard-empty-state button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  padding: 9px 13px;
}
.dashboard-snap-preview {
  z-index: 1;
  border: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  pointer-events: none;
}

.dashboard-widget {
  position: relative;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  container-type: inline-size;
}

.dashboard-widget.content-widget {
  grid-template-rows: minmax(0, 1fr);
}
.dashboard-widget.content-widget > .dashboard-widget-header {
  position: absolute;
  z-index: 15;
  inset: 0 0 auto;
  height: 36px;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.dashboard-widget.maximized {
  position: absolute;
  inset: 0;
  z-index: 100;
  width: auto;
  height: auto;
  border-radius: 0;
  border-color: var(--border);
  box-shadow: 0 24px 90px rgb(0 0 0 / 0.32);
  container-type: normal;
  grid-template-rows: 48px minmax(0, 1fr);
}

.dashboard-widget.content-widget.maximized {
  grid-template-rows: minmax(0, 1fr);
}

.dashboard-widget.interacting {
  z-index: 20;
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.22);
  opacity: 0.92;
}

.dashboard-widget.active {
  border-color: var(--border);
}

/* Non-document widgets previously contained many 8–10px labels. */
.dashboard-widget.content-widget {
  font-size: 14px;
}
.dashboard-widget.content-widget button,
.dashboard-widget.content-widget input,
.dashboard-widget.content-widget select,
.dashboard-widget.content-widget textarea {
  font-size: 13px !important;
}
.dashboard-widget.content-widget small,
.dashboard-widget.content-widget time,
.dashboard-widget.content-widget em,
.dashboard-widget.content-widget code {
  font-size: 12px !important;
}
.dashboard-widget.content-widget strong {
  font-size: 14px !important;
}
.dashboard-widget.content-widget p {
  font-size: 13px;
}

.dashboard-widget-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 0 10px 0 12px;
  min-width: 0;
}

.dashboard-widget-chrome {
  position: absolute;
  z-index: 24;
  top: 4px;
  left: 50%;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel-subtle) 92%, transparent);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
}
.dashboard-widget:hover .dashboard-widget-chrome,
.dashboard-widget.interacting .dashboard-widget-chrome,
.dashboard-widget-chrome:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.dashboard-widget.content-widget > .dashboard-widget-header .dashboard-widget-chrome {
  pointer-events: none;
}
.dashboard-widget.content-widget:hover > .dashboard-widget-header .dashboard-widget-chrome,
.dashboard-widget.content-widget > .dashboard-widget-header .dashboard-widget-chrome:focus-within {
  pointer-events: auto;
}

.dashboard-widget-header strong,
.markdown-widget-header-main,
.widget-filename-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-widget-header strong {
  font-size: 0.85rem;
}

.markdown-widget-header-main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.widget-navigation-buttons {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1px;
}

.widget-navigation-buttons button {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.widget-navigation-buttons button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
}

.widget-navigation-buttons button:disabled {
  cursor: default;
  opacity: 0.32;
}

.widget-memo-toggle {
  display: inline-flex;
  width: 25px;
  height: 25px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.widget-memo-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.widget-memo-toggle.active {
  background: color-mix(in srgb, #d69b29 16%, transparent);
  color: #b77a13;
}

.widget-filename-label {
  display: block;
  width: 100%;
  color: var(--text);
  font-weight: 700;
  padding: 4px 6px;
}

.markdown-widget-controls,
.widget-mode-group,
.widget-font-group,
.widget-action-group,
.widget-more {
  display: flex;
  align-items: center;
}

.markdown-widget-controls {
  flex: none;
  gap: 6px;
  min-width: max-content;
}

.widget-action-group {
  gap: 3px;
}

.widget-font-group {
  gap: 3px;
}

.widget-mode-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.widget-header-button,
.widget-icon-button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.widget-header-button {
  width: 34px;
  gap: 0;
  padding: 0;
  font-size: 0.78rem;
}

.widget-header-button span {
  display: none;
}

.widget-icon-button {
  width: 34px;
  padding: 0;
}

.widget-header-button svg,
.widget-icon-button svg {
  width: 18px;
  height: 18px;
}

.widget-width-symbol {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.widget-icon-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.widget-header-button:hover,
.widget-icon-button:hover,
.widget-header-button.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.widget-more {
  position: relative;
}

.widget-mode-group,
.widget-font-group,
.widget-action-group {
  display: none;
}

.dashboard-widget.maximized .widget-mode-group,
.dashboard-widget.maximized .widget-font-group,
.dashboard-widget.maximized .widget-action-group {
  display: flex;
}

.dashboard-widget.maximized .widget-more {
  display: none;
}

.widget-more-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  background: transparent;
}

.widget-more-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 31;
  display: grid;
  min-width: 180px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.22);
  padding: 6px;
}

.widget-more-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
}

.widget-more-menu button:hover {
  background: var(--panel-subtle);
}

.widget-more-menu button:disabled {
  cursor: default;
  opacity: 0.45;
}

.widget-more-menu button:disabled:hover {
  background: transparent;
}

.widget-more-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.widget-raw-editor {
  padding: 14px;
}

.dashboard-widget-tools {
  flex: none;
  gap: 0;
}

.dashboard-chrome-mover {
  display: inline-flex;
  width: 14px;
  height: 26px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  cursor: move;
  padding: 0;
  touch-action: none;
}

.dashboard-chrome-mover:hover {
  color: var(--muted);
}

.dashboard-widget-tools button {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.dashboard-widget-tools button:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.dashboard-move-handle {
  position: static;
  z-index: 12;
  display: inline-flex;
  flex: none;
  width: 34px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  padding: 0;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
  touch-action: none;
}

.dashboard-move-handle:active {
  cursor: grabbing;
}

.dashboard-move-handle:hover,
.dashboard-move-handle:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.dashboard-widget-body {
  min-height: 0;
  overflow: hidden;
}

.dashboard-widget-body .markdown-preview {
  padding: 16px;
}

.dashboard-scaled-preview {
  height: 100%;
  min-height: 0;
}

.dashboard-scaled-preview .markdown-preview {
  height: 100%;
}

.dashboard-scaled-preview .markdown-preview > * {
  max-width: var(--view-content-width, 980px);
}

.dashboard-widget-body .markdown-preview h1 {
  font-size: 1.45rem;
}

.dashboard-widget-body .markdown-preview h2 {
  margin-top: 1rem;
}

.dashboard-note {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: var(--panel);
  color: var(--text);
  line-height: 1.55;
  padding: 12px;
}

.dashboard-web {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.dashboard-image-frame {
  display: block;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: color-mix(in srgb, var(--panel-subtle) 70%, var(--panel));
  padding: 12px;
}
.dashboard-image-frame.pannable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.dashboard-image-frame.pannable.panning {
  cursor: grabbing;
}

.dashboard-image-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.dashboard-image-controls {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: 0 2px 10px rgb(0 0 0 / 16%);
}

.dashboard-image-controls button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboard-image-canvas {
  min-width: 25%;
}

.dashboard-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.dashboard-empty {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px;
  text-align: center;
}

.dashboard-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: flex-end;
  justify-content: flex-end;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: se-resize;
  opacity: 0;
  pointer-events: none;
  padding: 0 4px 4px 0;
  transition: opacity 120ms ease, color 120ms ease;
  touch-action: none;
}

.dashboard-widget:hover .dashboard-resize,
.dashboard-resize:hover,
.dashboard-resize:focus-visible,
.dashboard-widget.interacting .dashboard-resize {
  opacity: 1;
  pointer-events: auto;
}

.dashboard-resize:hover {
  color: var(--accent);
}

@media (pointer: coarse) {
  .dashboard-widget-chrome,
  .dashboard-resize {
    opacity: 1;
    pointer-events: auto;
  }
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.46);
  padding: 18px;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.46);
  padding: 18px;
}

.settings-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(820px, 100%);
  height: min(620px, 86vh);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 80px rgb(0 0 0 / 0.32);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.settings-body {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: scroll;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 14px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-subtle) 55%, var(--panel));
  padding: 10px 8px;
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 9px;
  text-align: left;
}

.settings-nav button:hover,
.settings-nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-version {
  margin-top: auto;
  padding: 10px 9px 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.settings-choice {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
}

.settings-info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 14px;
}

.settings-info-card p {
  color: var(--muted);
  line-height: 1.55;
}

.encryption-settings {
  display: grid;
  gap: 14px;
}
.encryption-settings-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 2px 8px;
}
.encryption-settings-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
}
.encryption-settings-hero > div:last-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.encryption-settings-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.encryption-settings-title-row strong {
  font-size: 1rem;
}
.encryption-settings-title-row i {
  border-radius: 999px;
  padding: 3px 7px;
  font-size: .68rem;
  font-style: normal;
  font-weight: 600;
}
.encryption-settings-title-row i.configured {
  background: color-mix(in srgb, #22a06b 14%, var(--panel));
  color: #39ad7d;
}
.encryption-settings-title-row i.not-configured {
  background: var(--panel-subtle);
  color: var(--muted);
}
.encryption-settings-hero p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}
.encryption-settings-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-subtle);
}
.encryption-settings-card > header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px 10px;
}
.encryption-settings-card > header > svg {
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}
.encryption-settings-card > header > div {
  display: grid;
  gap: 3px;
}
.encryption-settings-card > header small,
.encryption-disabled-hint {
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.45;
}
.encryption-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 14px 14px;
}
.encryption-password-row input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  padding: 0 11px;
}
.encryption-password-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.encryption-password-row button {
  min-width: 94px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 0 14px;
  font-weight: 600;
}
.encryption-password-row button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.encryption-settings-feedback {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text-muted);
  padding: 9px 14px;
  font-size: .75rem;
}
.encryption-target-list {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}
.encryption-target-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  padding: 10px 11px;
}
.encryption-target-list label:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.encryption-target-list label > svg {
  color: var(--muted);
}
.encryption-target-list label > span {
  display: grid;
  gap: 2px;
}
.encryption-target-list label small {
  color: var(--muted);
  font-size: .7rem;
}
.encryption-target-list input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.encryption-target-list input:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.encryption-disabled-hint {
  display: block;
  padding: 0 14px 12px;
}
.encryption-settings-warning {
  border: 1px solid color-mix(in srgb, #d99a2b 42%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, #d99a2b 8%, var(--panel));
  padding: 11px 13px;
}
.encryption-settings-warning strong {
  color: #c58b25;
  font-size: .82rem;
}
.encryption-settings-warning p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
}
@media (max-width: 620px) {
  .encryption-password-row {
    grid-template-columns: 1fr;
  }
  .encryption-password-row button {
    min-height: 38px;
  }
}

.third-party-notices {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 10px 12px;
}

.third-party-notices summary {
  cursor: pointer;
  font-weight: 600;
}

.third-party-notices pre {
  margin: 12px 0 0;
  overflow: auto;
  color: var(--muted);
  font: 0.75rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.model-provider-list {
  display: grid;
  gap: 9px;
}
.model-provider-list > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.model-provider-list > header div {
  display: grid;
  gap: 2px;
}
.model-provider-list > header small {
  color: var(--text-muted);
}
.model-provider-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.model-provider-card {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}
.model-provider-card:hover,
.model-provider-card.selected {
  border-color: var(--accent);
}
.model-provider-card.selected {
  background: var(--accent-soft);
}
.model-provider-card > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.model-provider-card > span small {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-provider-card > i {
  flex: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 3px 6px;
  font-size: 8px;
  font-style: normal;
}
.model-provider-card > i.configured {
  background: color-mix(in srgb, #22c55e 16%, var(--surface));
  color: #16a34a;
}
@media (max-width: 720px) {
  .model-provider-cards {
    grid-template-columns: 1fr;
  }
}
.model-provider-manager {
  display: grid;
  gap: 10px;
}
.model-provider-manager .model-provider-cards {
  grid-template-columns: 1fr;
}
.model-provider-manager > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-provider-manager > header > div {
  display: grid;
  gap: 2px;
}
.model-provider-manager > header small {
  color: var(--text-muted);
}
.model-provider-manager > header > span,
.model-provider-actions {
  display: flex;
  gap: 6px;
}
.model-provider-manager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 6px 8px;
}
.model-provider-entry {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}
.model-provider-entry.selected {
  border-color: var(--accent);
}
.model-provider-summary {
  width: 100%;
  justify-content: space-between !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 10px !important;
  text-align: left;
}
.model-provider-row {
  display: flex;
  align-items: stretch;
}
.model-provider-row .model-provider-summary {
  flex: 1;
  min-width: 0;
}
.model-provider-edit {
  flex: none;
  align-self: center;
  margin-right: 8px;
  border: 1px solid var(--border) !important;
  background: var(--surface-raised) !important;
  color: var(--text-muted) !important;
}
.model-provider-edit:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.model-provider-summary > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.model-provider-summary small {
  color: var(--text-muted);
}
.model-provider-summary > i {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  color: var(--text-muted);
  padding: 3px 6px;
  font-size: 8px;
  font-style: normal;
}
.model-provider-summary > i.configured {
  background: color-mix(in srgb, #22c55e 16%, var(--surface));
  color: #16a34a;
}
.model-provider-editor {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding: 10px;
}
.model-provider-editor > label,
.model-provider-editor .rag-number-grid > label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9px;
}
.model-provider-editor input,
.model-provider-editor select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 7px;
}

.model-provider-fixed-type {
  display: flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: 0 10px;
}
.model-provider-actions {
  justify-content: space-between;
}
.model-provider-actions .danger {
  color: var(--danger);
}
.model-checklist {
  display: grid;
  max-height: 220px;
  overflow: auto;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
}
.model-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-checklist input {
  width: auto;
}

.projects-settings {
  display: grid;
  gap: 12px;
}
.projects-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.projects-settings-header > div {
  display: grid;
  gap: 2px;
}
.projects-settings-header small {
  color: var(--muted);
  font-size: 0.72rem;
}
.project-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-subtle);
  padding: 12px;
}
.project-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-editor > header button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.project-editor > footer {
  display: flex;
  justify-content: flex-end;
}
.project-list {
  display: grid;
  gap: 7px;
}
.project-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 9px 10px;
}
.project-list article.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}
.project-list-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-subtle);
  color: var(--accent);
}
.project-list article > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.project-list article > div:nth-child(2) small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 7px;
  font-size: 0.67rem;
  font-weight: 600;
}
.project-icon-button {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}
.project-icon-button:hover {
  background: var(--panel-subtle);
  color: var(--text);
}
.project-icon-button.danger:hover {
  color: var(--danger);
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field span {
  color: var(--muted);
  font-size: 0.86rem;
}

.settings-field > input,
.settings-field > textarea {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 9px 10px;
  resize: vertical;
}

.settings-field > input:focus,
.settings-field > textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.86rem;
}

.settings-warning {
  border: 1px solid color-mix(in srgb, #e5a22b 48%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, #e5a22b 9%, var(--panel));
  padding: 12px;
}

.settings-warning p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.settings-status {
  color: #d56b5d;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.settings-status.ok {
  color: #3ba57a;
}

.discord-connection-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.discord-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.discord-status.connected {
  color: #3ba57a;
}

.discord-activity {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-subtle);
  padding: 9px 10px;
  font-size: 0.76rem;
}

.discord-activity span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.discord-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 660px) {
  .discord-check-grid {
    grid-template-columns: 1fr;
  }
}

.slash-command-list,
.mcp-server-list {
  display: grid;
  gap: 10px;
}

.slash-command-list article,
.mcp-server-list article {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 12px;
}

.mcp-server-list .slash-command-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slash-command-mcp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.slash-command-mcp legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
}
.slash-command-mcp label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.slash-command-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slash-command-heading button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.slash-command-heading button:hover {
  color: var(--danger);
}

.rag-setting-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
}

.rag-setting-selector .settings-browse {
  gap: 5px;
  white-space: nowrap;
}

.rag-setting-selector .settings-browse.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  color: var(--danger);
}

.rag-setting-selector .settings-browse:disabled,
.rag-sync-row .settings-choice:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.rag-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rag-sync-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.rag-sync-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rag-error-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 7%, var(--panel));
  padding: 10px;
}

.rag-error-list strong {
  color: var(--danger);
  font-size: 0.78rem;
}

.rag-error-list code {
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rag-error-list small {
  color: var(--muted);
}

.vertex-oauth-settings {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 12px;
}

.vertex-advanced {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 8px 10px;
}

.vertex-advanced summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
}

.vertex-advanced[open] summary {
  margin-bottom: 10px;
}

.vertex-advanced > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.vertex-oauth-settings > div:first-child,
.vertex-oauth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vertex-oauth-settings > div:first-child span {
  color: var(--muted);
  font-size: 0.75rem;
}

.vertex-oauth-settings > div:first-child span.connected {
  color: #3ba57a;
}

.vertex-oauth-actions small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.settings-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.settings-path-row input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  padding: 0 10px;
}

.settings-path-row input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.settings-browse {
  display: inline-flex;
  height: 36px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
}

.settings-browse:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.file-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgb(0 0 0 / 0.28);
  padding: min(11vh, 96px) 18px 18px;
}

.file-picker {
  display: grid;
  grid-template-rows: 52px minmax(260px, 1fr);
  width: min(760px, 100%);
  max-height: min(680px, 82vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 90px rgb(0 0 0 / 0.34);
}

.file-picker-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 8px;
}

.file-picker-search {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 10px;
}

.file-picker-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.file-picker-browse,
.file-picker-close {
  display: inline-flex;
  height: 36px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.file-picker-browse {
  gap: 7px;
  padding: 0 12px;
}

.file-picker-close {
  width: 36px;
  justify-content: center;
  padding: 0;
}

.file-picker-browse:hover,
.file-picker-close:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.file-picker-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 0;
}

.file-picker-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  background: var(--panel-subtle);
  padding: 10px;
}

.file-picker-rail button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.file-picker-rail button.active,
.file-picker-rail button:hover {
  background: var(--panel);
  color: var(--text);
}

.file-picker-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.file-picker-list-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 10px 8px;
  color: var(--text);
}

.file-picker-list-summary > span {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.file-picker-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.file-picker-item > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.file-picker-item > span strong,
.file-picker-item > span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-item > span small,
.file-picker-item time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
}

.file-picker-item:hover,
.file-picker-item:focus-visible,
.file-picker-item.selected {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.file-picker-empty {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.history-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(720px, 88vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 80px rgb(0 0 0 / 0.32);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.history-header > div:first-child {
  display: grid;
  gap: 2px;
}

.history-header span,
.history-item-main span,
.history-item-main small {
  color: var(--muted);
}

.history-header span {
  font-size: 0.82rem;
}

.diff-file-picker {
  position: relative;
  width: min(440px, 52vw);
  margin-left: auto;
}

.diff-file-picker-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 7px 10px;
  text-align: left;
}

.diff-file-picker-trigger:hover,
.diff-file-picker-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: var(--accent-soft);
}

.diff-file-picker-trigger > span {
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-file-picker-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  width: min(520px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.3);
}

.diff-file-picker-popover > label {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 11px;
}

.diff-file-picker-popover input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.diff-file-picker-popover > div {
  max-height: min(390px, 52vh);
  overflow-y: auto;
  padding: 6px;
}

.diff-file-picker-popover > div > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 8px 9px;
  text-align: left;
}

.diff-file-picker-popover > div > button:hover,
.diff-file-picker-popover > div > button.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.diff-file-picker-popover > div > button > span {
  overflow: hidden;
  color: inherit;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-file-picker-popover > div > p {
  margin: 0;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.history-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  min-height: 0;
}

.history-body.compare {
  display: block;
  overflow: hidden;
}

.history-body.compare > .history-diff-panel {
  height: 100%;
}

.history-body.compare > .history-diff-empty {
  display: grid;
  height: 100%;
  place-items: center;
}

.history-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 12px;
  border-right: 1px solid var(--border);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}

.history-item.selected {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: var(--accent-soft);
}

.history-item-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.history-item-main strong,
.history-item-main span,
.history-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-main span,
.history-item-main small {
  font-size: 0.82rem;
}

.history-restore {
  display: inline-flex;
  height: 32px;
  flex: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
}

.history-restore:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.history-restore:disabled {
  cursor: default;
  opacity: 0.65;
}

.history-empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.history-diff-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.history-diff-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

.history-diff-header div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.history-diff-header strong,
.history-diff-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-diff-header span,
.history-diff-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-added {
  color: #059669;
}

.history-removed {
  color: #dc2626;
}

.diff-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, 128px);
  width: 256px;
  justify-self: start;
  max-width: 100%;
}

.diff-mode-toggle button {
  display: inline-flex;
  height: 36px;
  width: 128px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  line-height: 1;
}

.diff-mode-toggle button:first-child {
  border-radius: 6px 0 0 6px;
}

.diff-mode-toggle button:last-child {
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.diff-mode-toggle button.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.history-diff-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 16px;
}

.history-diff-pre {
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 0;
  background: var(--panel);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.history-diff-line,
.history-diff-split-row,
.history-diff-split-cell {
  min-width: 0;
}

.history-diff-line {
  display: grid;
  grid-template-columns: 42px 42px 22px minmax(0, 1fr);
}

.history-diff-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.history-diff-split-cell {
  display: grid;
  grid-template-columns: 42px 22px minmax(0, 1fr);
  border-right: 1px solid var(--border);
}

.history-diff-split-cell:last-child {
  border-right: 0;
}

.history-diff-num,
.history-diff-sign {
  user-select: none;
  color: var(--muted);
  text-align: right;
}

.history-diff-num {
  padding-right: 8px;
}

.history-diff-sign {
  text-align: center;
}

.history-diff-text {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-diff-line.added,
.history-diff-split-cell.added {
  background: color-mix(in srgb, #059669 12%, var(--panel));
  color: color-mix(in srgb, #047857 72%, var(--text));
}

.history-diff-line.removed,
.history-diff-split-cell.removed {
  background: color-mix(in srgb, #dc2626 10%, var(--panel));
  color: color-mix(in srgb, #b42318 72%, var(--text));
}

.history-diff-split-cell.empty {
  background: var(--panel-subtle);
}

@media (max-width: 700px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
  }

  .document-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 8px 10px;
  }

  .document-meta-inline,
  .document-toolbar .toolbar {
    width: 100%;
  }

  .document-toolbar .toolbar {
    justify-content: flex-end;
  }

  .save-status {
    display: none;
  }

  .modebar {
    overflow-x: auto;
  }

  .markdown-preview {
    padding: 20px 16px;
  }

  .dashboard-command span {
    display: none;
  }

  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-widget {
    min-height: 280px;
  }

  .history-item {
    align-items: stretch;
    flex-direction: column;
  }

  .history-restore {
    justify-content: center;
    width: 100%;
  }

  .history-body {
    grid-template-columns: 1fr;
  }

  .history-list {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .history-diff-header {
    grid-template-columns: 1fr;
  }

  .diff-mode-toggle {
    justify-self: start;
  }

  .file-picker-body {
    grid-template-columns: 1fr;
  }

  .file-picker-rail {
    display: none;
  }

  .file-picker-header {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .file-picker-browse {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
}

@container (min-width: 520px) {
  .widget-mode-group {
    display: flex;
  }
}

@container (min-width: 920px) {
  .widget-font-group,
  .widget-action-group {
    display: flex;
  }

  .widget-more {
    display: none;
  }
}

/* ---- Memo timeline (specs/memo.md) ---- */

.widget-icon-button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.file-widget-body {
  display: flex;
  height: 100%;
  min-height: 0;
}

.file-widget-content {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-widget-content > * {
  flex: 1;
  min-height: 0;
}

.file-widget-search-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-widget-search-content > * {
  flex: 1;
  min-height: 0;
}

.file-widget-search {
  position: absolute;
  z-index: 20;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(390px, calc(100% - 16px));
  min-height: 34px;
  padding: 4px 5px 4px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
  color: var(--muted);
}

.file-widget-search input {
  flex: 1;
  min-width: 60px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.file-widget-search-count {
  flex: none;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.file-widget-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.file-widget-search button:hover:not(:disabled) {
  background: var(--hover);
}

.file-widget-search button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Timeline panel opens on the left side of the widget (§7.1). */
.memo-panel {
  display: flex;
  flex-direction: column;
  flex: none;
  width: min(320px, 45%);
  min-width: 220px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.memo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.memo-panel-header-actions {
  display: flex;
  gap: 2px;
}

/* Collapsed memo panel: a narrow rail with a re-open button (». */
.memo-panel-rail {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 26px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding-top: 6px;
}

.memo-panel-rail button {
  display: inline-flex;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 4px 2px;
  cursor: pointer;
}

.memo-panel-rail button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.memo-panel-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memo-panel-empty,
.memo-panel-error {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 12px 6px;
  text-align: center;
}

.memo-panel-error {
  color: var(--danger);
}

.memo-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  padding: 8px 10px;
  font-size: 0.85rem;
  transition: background-color 0.4s ease;
}

.memo-entry-flash {
  animation: memo-entry-flash 1s ease;
}

@keyframes memo-entry-flash {
  0% {
    background-color: var(--accent-soft);
  }
  100% {
    background-color: transparent;
  }
}

.memo-entry-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.memo-entry-pinned {
  color: var(--accent);
}

.memo-entry-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.memo-entry:hover .memo-entry-actions {
  opacity: 1;
}

.memo-entry-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
}

.memo-entry-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.memo-entry-quote {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin: 6px 0 2px;
  padding: 4px 6px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.8rem;
}

.memo-entry-quote svg {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.memo-entry-quote.unresolved {
  border-left-color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.memo-entry-quote.unresolved svg {
  color: var(--muted);
}

.memo-entry-quote blockquote {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.memo-entry-anchor {
  flex: none;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--panel);
  border-radius: 4px;
  padding: 0 4px;
  margin-top: 2px;
}

.memo-entry-body .markdown-preview {
  padding: 0;
  font-size: 0.85rem;
}

.memo-entry-body .markdown-preview > :first-child {
  margin-top: 4px;
}

.memo-entry-body .markdown-preview > :last-child {
  margin-bottom: 0;
}

.memo-entry-toggle {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 0;
}

.memo-entry-edit textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 6px;
  font-size: 0.85rem;
}

.memo-entry-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.memo-entry-edit-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.memo-entry-edit-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.memo-panel-composer {
  border-top: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.memo-draft {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 6px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
}

.memo-draft blockquote {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.memo-draft button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
}

.memo-composer-input textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 6px;
  font-size: 0.85rem;
}

.memo-composer-input .wysiwyg-host {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.memo-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.memo-post-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.memo-post-button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Selection context menu / hover popover / toast (§7.2, §7.3). */
.memo-context-menu {
  position: absolute;
  z-index: 25;
  display: grid;
  min-width: 150px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
  padding: 4px;
}

.memo-context-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 6px 9px;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.memo-context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.memo-hover-popover {
  position: absolute;
  z-index: 24;
  max-width: 320px;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
  padding: 7px 10px;
  font-size: 0.78rem;
}

.memo-hover-popover p {
  margin: 0;
}

.memo-hover-count {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.memo-toast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}

/* ---- pdf.js viewer (§6.1) ---- */

.pdf-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-subtle);
}

.pdf-viewer-pages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  /* `safe` keeps the left edge reachable when a zoomed page overflows. */
  align-items: safe center;
  gap: 12px;
  padding: 12px;
  user-select: text;
}

.pdf-page {
  position: relative;
  flex: none;
  background: #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
  user-select: text;
}

.pdf-page canvas {
  display: block;
  pointer-events: none;
  user-select: none;
}

.pdf-viewer-toolbar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 3px 8px;
  font-size: 0.78rem;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.pdf-viewer:hover .pdf-viewer-toolbar {
  opacity: 1;
}

.pdf-viewer-toolbar button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.pdf-viewer-toolbar button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* pdf.js text layer styles (selection + search only). */
.textLayer {
  color-scheme: only light;
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: clip;
  opacity: 1;
  line-height: 1;
  letter-spacing: normal;
  word-spacing: normal;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  caret-color: CanvasText;
  z-index: 1;
  pointer-events: auto;
  user-select: text;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}

.textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  user-select: text;
}

.textLayer > :not(.markedContent),
.textLayer .markedContent span:not(.markedContent) {
  z-index: 1;
  --font-height: 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  --scale-x: 1;
  --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x))
    scale(var(--min-font-size-inv));
}

.textLayer .markedContent {
  display: contents;
}

.textLayer span[role="img"] {
  cursor: default;
  user-select: none;
}

.textLayer ::selection {
  background: color-mix(in srgb, AccentColor, transparent 50%);
  color: transparent;
}

.textLayer.selectionRendering ::selection {
  background: transparent;
  color: transparent;
}

.textLayer br::selection {
  background: transparent;
}

.textLayer .endOfContent {
  display: block;
  position: absolute;
  inset: 100% 0 0;
  z-index: 0;
  cursor: default;
  user-select: none;
}

.textLayer.selecting .endOfContent {
  top: 0;
}

/* ---- Memo list modal ---- */

.memo-list-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(9 14 20 / 0.45);
  padding: 24px;
}

.app-tool-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgb(9 14 20 / 0.52);
  padding: 24px;
}
.ide-frame.tool-modal-open {
  visibility: hidden;
}

.app-secret-manager-modal,
.app-calendar-modal,
.app-timeline-modal,
.app-kanban-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  height: min(760px, 90vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}

.app-secret-manager-body,
.app-calendar-body,
.app-timeline-body,
.app-kanban-body {
  min-height: 0;
  overflow: hidden;
}

.app-modal-drag-handle {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.app-modal-drag-handle:active {
  cursor: grabbing;
}

.app-calendar-body > .dashboard-calendar-widget {
  height: 100%;
  padding: 18px;
}

.app-secret-manager-body > .dashboard-secret-widget {
  height: 100%;
}

/* The dashboard version is intentionally compact. The header-launched
   manager has enough space to use the application's normal text size. */
.app-secret-manager-body .dashboard-secret-widget {
  font-size: 13px;
}

.app-secret-manager-body .dashboard-secret-widget > header,
.app-secret-manager-body .dashboard-secret-widget > header > span,
.app-secret-manager-body .dashboard-secret-widget > header button,
.app-secret-manager-body .secret-folder-bar,
.app-secret-manager-body .secret-group > button {
  font-size: 12px;
}

.app-secret-manager-body .secret-list > div[role="button"] strong,
.app-secret-manager-body .secret-group > div > div[role="button"] strong {
  font-size: 13px;
}

.app-secret-manager-body .secret-list > div[role="button"] em,
.app-secret-manager-body .secret-list > div[role="button"] small,
.app-secret-manager-body .secret-group > div > div[role="button"] em,
.app-secret-manager-body .secret-group > div > div[role="button"] small,
.app-secret-manager-body .dashboard-widget-empty,
.app-secret-manager-body .dashboard-widget-error {
  font-size: 11px;
}

.app-secret-manager-body .secret-group > button > span {
  font-size: 10px;
}

.encryption-directory-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin: 0 14px 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.encryption-directory-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.encryption-directory-field > span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-raised);
  font-size: 12px;
  white-space: nowrap;
}

.encryption-directory-field > input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
}

.app-timeline-body > .dashboard-timeline-widget,
.app-kanban-body > .dashboard-kanban-widget {
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 18px;
}

/* Dashboard widgets use compact typography. Header-launched Timeline has
   enough room for normal controls, while post Markdown keeps its own sizing. */
.app-timeline-body .timeline-toolbar,
.app-timeline-body .timeline-toolbar strong {
  font-size: 13px;
}
.app-timeline-body .timeline-toolbar select {
  height: 30px;
  font-size: 12px;
}

.app-timeline-body .timeline-filters input,
.app-timeline-body .timeline-filters select,
.app-timeline-body .timeline-filters .timeline-pinned-only,
.app-timeline-body .timeline-feed article > details > summary,
.app-timeline-body .timeline-post-toggle,
.app-timeline-body .timeline-tags button,
.app-timeline-body .timeline-load-more,
.app-timeline-body .timeline-composer-mode span,
.app-timeline-body .timeline-new-button span,
.app-timeline-body .timeline-composer-actions button,
.app-timeline-body .timeline-ai-form label,
.app-timeline-body .timeline-ai-form button {
  font-size: 12px;
}

.app-timeline-body .timeline-feed article > header,
.app-timeline-body .timeline-feed article > header code,
.app-timeline-body .timeline-feed article > header button,
.app-timeline-body .timeline-attachments > span {
  font-size: 11px;
}

.app-timeline-body .timeline-inline-editor textarea,
.app-timeline-body .timeline-inline-editor button,
.app-timeline-body .timeline-composer-editor textarea,
.app-timeline-body .timeline-composer-editor .wysiwyg-host {
  font-size: 13px;
}

.app-launcher-modal {
  width: min(560px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgb(0 0 0 / 0.35);
}

.app-launcher-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
}

.app-launcher-modal > header button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.app-launcher-modal > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.app-launcher-modal > div > button {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 14px;
}

.app-launcher-modal > div > button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
}

.memo-list-modal {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(560px, 90vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
  overflow: hidden;
}

.memo-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.memo-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--muted);
}

.memo-list-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.memo-list-body {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
}

.memo-list-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 32px 0;
}

.memo-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.memo-list-item:hover {
  background: var(--accent-soft);
}

.memo-list-item svg {
  flex: none;
  color: var(--muted);
}

.memo-list-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.memo-list-item-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-list-item-path {
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-list-item-preview {
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-list-item-time {
  flex: none;
  color: var(--muted);
  font-size: 0.74rem;
}

.memo-list-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.memo-list-pager button {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 4px 8px;
  cursor: pointer;
}

.memo-list-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.settings-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-subtle);
  color: var(--text);
  padding: 8px 10px;
}
.dashboard-calendar-widget {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  overflow: auto;
  color: var(--text);
}
.dashboard-calendar-widget > header,
.dashboard-calendar-widget > nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dashboard-calendar-widget > header span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.dashboard-calendar-widget button {
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  border-radius: 6px;
  cursor: pointer;
}
.dashboard-calendar-widget > header button {
  padding: 5px 10px;
}
.dashboard-calendar-widget > nav button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
}
.dashboard-calendar-widget > nav div {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.dashboard-calendar-widget .event-dot,
.dashboard-calendar-widget .post-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dashboard-calendar-widget .event-dot {
  background: #f59e0b;
}
.dashboard-calendar-widget .post-dot {
  background: #8b5cf6;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  gap: 3px;
}
.calendar-grid .weekday {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}
.calendar-grid .day-0 {
  color: #ef4444;
}
.calendar-grid .day-6 {
  color: #3b82f6;
}
.calendar-day {
  position: relative;
  min-height: 42px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}
.calendar-day.outside {
  opacity: .38;
}
.calendar-day.today > span {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.calendar-day.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.calendar-day i {
  display: flex;
  gap: 3px;
  align-self: center;
  min-height: 7px;
}
.calendar-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.52);
}
.calendar-detail {
  position: relative;
  width: min(720px, 94vw);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.calendar-detail > .close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}
.calendar-detail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 32px;
}
.calendar-detail > header h3 {
  margin: 0;
}
.calendar-detail > header button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
}
.calendar-detail form {
  margin: 14px 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.calendar-detail form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.calendar-detail form input,
.calendar-detail form textarea,
.calendar-detail-group article > input {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
}
.calendar-detail form textarea {
  min-height: 90px;
  resize: vertical;
}
.calendar-detail form footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.calendar-detail form footer button {
  padding: 7px 13px;
}
.calendar-detail .empty {
  padding: 36px 10px;
  text-align: center;
  color: var(--text-muted);
}
.calendar-detail-group {
  margin-top: 18px;
}
.calendar-detail-group h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.calendar-detail-group article {
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.calendar-detail-group article > input {
  float: right;
  margin: 0 0 8px 10px;
}
.calendar-event-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 11px;
}
.calendar-event-actions button {
  display: inline-grid;
  place-items: center;
  padding: 5px;
}
.calendar-event-actions button:last-child:hover {
  color: var(--danger);
}
.calendar-detail-group article .markdown-preview {
  height: auto;
  overflow: visible;
  padding: 2px 0 0;
  line-height: 1.55;
}
.calendar-detail-group article .markdown-preview > :first-child {
  margin-top: 0;
}
.calendar-detail-group article .markdown-preview > :last-child {
  margin-bottom: 0;
}
.calendar-detail form.calendar-event-edit-form {
  margin: 0;
  padding: 2px;
  border: 0;
  background: transparent;
}

.timeline-feed .markdown-preview img {
  display: block;
  max-width: 100%;
  max-height: 256px;
  border-radius: 7px;
  object-fit: contain;
  cursor: zoom-in;
}
.timeline-note-embed {
  margin: 10px 0;
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}
.timeline-note-embed > .markdown-preview > :first-child {
  margin-top: 0;
}
.timeline-note-embed > .markdown-preview > :last-child {
  margin-bottom: 0;
}
.timeline-image-lightbox {
  position: fixed;
  z-index: 23000;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 72%);
  padding: 24px;
  cursor: zoom-out;
}
.timeline-image-lightbox > button {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  border-color: rgb(255 255 255 / 35%);
  background: rgb(0 0 0 / 45%);
  color: white;
  padding: 8px;
}
.timeline-image-lightbox > img {
  max-width: min(1200px, 94vw);
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
}
.agent-plugin-manager { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-color, #d1d5db); display: grid; gap: 10px; }
.agent-plugin-manager > header small, .agent-plugin-manager article small { display: block; opacity: .7; }
.agent-plugin-manager > article { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border-color, #d1d5db); border-radius: 8px; padding: 10px; }
.agent-plugin-preview { position: relative; align-items: flex-start !important; flex-direction: column; background: color-mix(in srgb, var(--accent-color, #3b82f6) 8%, transparent); }
.agent-plugin-preview-close { position: absolute; top: 6px; right: 6px; }
.agent-plugin-warning { color: #b7791f; }
.agent-plugin-preview code { display: block; max-width: 100%; overflow-wrap: anywhere; }
.agent-plugin-component-title { margin-top: 4px; }
