/* Cursor / VS Code workbench mockup */

.art-mat .cursor-ide {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.cursor-ide {
  --ide-bg: #181818;
  --ide-title: #141414;
  --ide-side: #141414;
  --ide-act: #141414;
  --ide-border: rgba(255, 255, 255, 0.06);
  --ide-tab-bg: #1f1f1f;
  --ide-tab-on: #181818;
  --ide-fg: #cccccc;
  --ide-dim: #858585;
  --ide-bright: #e8e8e8;
  --ide-accent: #3794ff;
  --ide-panel: #181818;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ide-fg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  background: var(--ide-bg);
  pointer-events: none;
  user-select: none;
}

.cursor-ide .ide-env-switch {
  pointer-events: auto;
}

.cursor-ide[data-env="vscode"] {
  --ide-bg: #1e1e1e;
  --ide-title: #323233;
  --ide-side: #252526;
  --ide-act: #333333;
  --ide-border: #3c3c3c;
  --ide-tab-bg: #2d2d2d;
  --ide-tab-on: #1e1e1e;
  --ide-panel: #252526;
  --ide-accent: #007acc;
}

.ide-tbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  background: var(--ide-title);
}

.ide-tbar-left,
.ide-tbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ide-tbar-right {
  justify-content: flex-end;
}

.ide-tbar-right .ide-icon {
  width: 16px;
  height: 16px;
  opacity: 0.72;
}

.ide-icon {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) invert(0.72);
  opacity: 0.85;
}

.ide-activity button .ide-icon {
  width: 22px;
  height: 22px;
}

.ide-activity button.on .ide-icon {
  opacity: 1;
  filter: brightness(0) invert(0.92);
}

.ide-activity .ide-act-agent .ide-icon {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(58%) sepia(86%) saturate(2878%) hue-rotate(189deg) brightness(1.02);
}

.tab-ico,
.ide-tree .ico[src*='typescript'] {
  filter: none;
  opacity: 1;
}

.ide-tree .ico[src*='folder'] {
  filter: brightness(0) invert(0.72);
  opacity: 0.9;
}

.ide-traffic {
  display: flex;
  gap: 7px;
}

.ide-traffic i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  font-style: normal;
}

.ide-traffic i:nth-child(1) { background: #ff5f57; }
.ide-traffic i:nth-child(2) { background: #febc2e; }
.ide-traffic i:nth-child(3) { background: #28c840; }

.ide-seg {
  display: flex;
  padding: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.ide-seg button {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ide-dim);
  cursor: default;
}

.ide-seg button.on {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ide-bright);
}

.ide-env-switch {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.ide-env-switch button {
  font-family: var(--font);
  font-size: 10px;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ide-dim);
  cursor: pointer;
}

.ide-env-switch button.on {
  color: var(--ide-bright);
  background: rgba(255, 255, 255, 0.1);
}

.ide-tbar-center {
  font-size: 12px;
  color: var(--ide-dim);
  text-align: center;
}

.ide-workbench {
  display: grid;
  grid-template-columns: 48px 160px minmax(0, 1fr) 292px;
  height: 472px;
  min-height: 472px;
  max-height: 472px;
}

.ide-activity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  background: var(--ide-act);
}

.ide-activity button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ide-dim);
  cursor: default;
  padding: 0;
}

.ide-activity button svg {
  width: 22px;
  height: 22px;
}

.ide-activity button .ide-icon {
  width: 22px;
  height: 22px;
}

.ide-activity button.on {
  color: var(--ide-bright);
  background: rgba(255, 255, 255, 0.08);
  width: 46px;
  border-radius: 0 4px 4px 0;
}

.ide-activity .ide-act-agent {
  margin-top: auto;
  color: var(--ide-accent);
}

.ide-sidebar {
  background: var(--ide-side);
  overflow: hidden;
}

.ide-sidebar-hd {
  padding: 10px 12px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ide-dim);
}

.ide-tree {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  font-size: 12px;
}

.ide-tree li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  color: var(--ide-fg);
  white-space: nowrap;
}

.ide-tree li.indent { padding-left: 20px; }
.ide-tree li.indent2 { padding-left: 34px; }

.ide-tree li.on {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ide-bright);
}

.ide-tree .chev {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ide-dim);
  border-bottom: 1.5px solid var(--ide-dim);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

.ide-tree .chev.open {
  transform: rotate(45deg) translateY(-2px);
}

.ide-tree .ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.9;
}

.ide-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--ide-bg);
  overflow: hidden;
}

.ide-tabs {
  display: flex;
  background: var(--ide-tab-bg);
  overflow-x: auto;
}

.ide-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--ide-dim);
  background: var(--ide-tab-bg);
  white-space: nowrap;
}

.ide-tab.on {
  background: var(--ide-tab-on);
  color: var(--ide-bright);
}

.tab-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
}

.tab-x {
  border: none;
  background: transparent;
  color: var(--ide-dim);
  font-size: 14px;
  padding: 0 0 0 4px;
  line-height: 1;
  cursor: default;
}

.ide-bc {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  font-size: 11px;
  color: var(--ide-dim);
}

.ide-bc .bc-sep { opacity: 0.45; }
.ide-bc .bc-active { color: var(--ide-bright); }

.bc-ts,
.bc-md {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
}

.bc-ts {
  filter: none;
}

.ide-editor-pane {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  background: var(--ide-bg);
  overflow: hidden;
}

.ide-gutter {
  padding: 6px 0;
  min-width: 52px;
  text-align: right;
  padding-right: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #6e7681;
  user-select: none;
  flex-shrink: 0;
}

.ide-gutter span {
  display: block;
}

.ide-code {
  flex: 1;
  margin: 0;
  padding: 6px 0 6px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ide-fg);
  white-space: pre;
  overflow: auto;
  min-width: 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.ide-minimap {
  display: none;
}

.ide-sbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  font-size: 11px;
  background: var(--ide-accent);
  color: #fff;
}

.ide-sbar-l { font-weight: 500; }

.syn-kw { color: #569cd6; }
.syn-fn { color: #dcdcaa; }
.syn-str { color: #ce9178; }
.syn-cm { color: #6a9955; }
.syn-ty { color: #4ec9b0; }
.syn-md-h { color: #569cd6; font-weight: 600; }
.syn-md-b { color: #d4d4d4; }
.syn-md-l { color: #b5cea8; }
.syn-b { color: #4fc1ff; }

.ide-panel {
  display: flex;
  flex-direction: column;
  background: var(--ide-panel);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ide-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ide-bright);
}

.ide-panel-actions {
  display: flex;
  gap: 10px;
  color: var(--ide-dim);
}

.ide-panel-actions .ide-icon {
  width: 14px;
  height: 14px;
}

.ide-panel-msgs {
  flex: 1;
  height: 148px;
  min-height: 148px;
  max-height: 148px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.ide-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.ide-msg-agent .ide-msg-body {
  font-size: 11px;
  line-height: 1.48;
  color: var(--ide-fg);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ide-msg-user .ide-msg-body {
  align-self: flex-end;
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ide-bright);
}

.ide-msg-user .ide-cmd {
  color: var(--ide-accent);
  font-weight: 600;
}

.ide-msg-meta {
  font-size: 10px;
  color: var(--ide-dim);
}

.ide-composer {
  padding: 8px 10px 10px;
  flex-shrink: 0;
}

.ide-chat-input-wrap {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.ide-chat-input {
  min-height: 52px;
  max-height: 52px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ide-bright);
  overflow: hidden;
}

.ide-chat-input:empty::before {
  content: attr(data-placeholder);
  color: var(--ide-dim);
}

.ide-chat-input .ide-cmd {
  color: var(--ide-accent);
  font-weight: 600;
}

.ide-chat-input.typing::after {
  content: "▋";
  color: var(--ide-dim);
  animation: ide-caret 1.1s step-end infinite;
}

.ide-chat-input.done::after {
  display: none;
}

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

.ide-chat-ft {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--ide-dim);
}

.ide-chat-ft .pill {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
}

.ide-chat-ft .send {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ide-bright);
  font-size: 13px;
}

.ide-agent-line {
  margin: 6px 2px 0;
  font-size: 11px;
  color: #89d185;
  min-height: 1.1em;
  max-height: 1.1em;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .ide-workbench {
    grid-template-columns: 40px minmax(0, 1fr) 260px;
    height: 440px;
    min-height: 440px;
    max-height: 440px;
  }

  .ide-sidebar {
    display: none;
  }

  .ide-minimap {
    display: none;
  }

  .ide-panel-msgs {
    height: 130px;
    min-height: 130px;
    max-height: 130px;
  }
}

@media (max-width: 768px) {
  .ide-tbar {
    grid-template-columns: minmax(0, 1fr) auto;
    height: 34px;
    padding: 0 8px;
    min-width: 0;
  }

  .ide-tbar-left {
    gap: 6px;
    min-width: 0;
    overflow: hidden;
  }

  .ide-tbar-center {
    display: none;
  }

  .ide-tbar-right .ide-icon {
    display: none;
  }

  .ide-seg button {
    padding: 3px 7px;
    font-size: 10px;
  }

  .ide-env-switch button {
    padding: 2px 6px;
    font-size: 9px;
  }

  .ide-traffic i {
    width: 9px;
    height: 9px;
  }

  .ide-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
    max-height: none;
    min-width: 0;
  }

  .ide-activity {
    display: none;
  }

  .ide-center {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    min-width: 0;
  }

  .ide-panel {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    min-width: 0;
  }

  .ide-panel-msgs {
    height: 140px;
    min-height: 140px;
    max-height: 140px;
  }

  .ide-tab:nth-child(2) {
    display: none;
  }

  .ide-bc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ide-code,
  .ide-gutter {
    font-size: 11px;
    line-height: 1.5;
  }

  .ide-gutter {
    min-width: 40px;
    padding-right: 8px;
  }

  .ide-sbar {
    font-size: 10px;
    padding: 0 8px;
    overflow: hidden;
  }

  .ide-sbar span:last-child {
    display: none;
  }

  .ide-chat-input {
    min-height: 48px;
    max-height: 48px;
    font-size: 12px;
  }

  .art-mat {
    padding: 20px 10px;
  }

  .cursor-ide {
    border-radius: 8px;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .ide-center {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }

  .ide-panel {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
  }

  .ide-panel-msgs {
    height: 110px;
    min-height: 110px;
    max-height: 110px;
  }

  .ide-seg {
    display: none;
  }

  .ide-env-switch {
    margin-left: 0;
  }

  .ide-env-switch button {
    padding: 2px 5px;
    font-size: 8px;
  }

  .ide-tbar-left {
    gap: 4px;
  }
}

@media (max-width: 900px) {
  .art-mat {
    padding: 24px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ide-msg,
  .ide-chat-input.typing::after {
    animation: none;
  }
}
