/* ---------- Visual Studio .NET 2003 ---------- */
.window .window-body.vs-body,
.window .window-body.mp-body,
.window .window-body.apphost-body {
  flex: 1; min-height: 0; margin: 0 3px 3px; padding: 0;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  font: 11px Tahoma, "Segoe UI", sans-serif;
}
.apphost-body { background: #fff; }
.apphost-frame { flex: 1; width: 100%; border: 0; display: block; background: #fff; }

.vs-root { background: #ece9d8; }
.vs-menubar { border-bottom: 1px solid #d4d0c8; }
.vs-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 2px 4px; height: 26px; flex-shrink: 0;
  background: linear-gradient(#fbfaf6, #e6e3d6); border-bottom: 1px solid #c4c1b5;
}
.window .vs-tb {
  min-width: 0; min-height: 0; height: 22px; padding: 0 3px; display: flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid transparent; border-radius: 0; box-shadow: none; font: 11px Tahoma, sans-serif; color: #000;
}
.window .vs-tb:hover { border-color: #316ac5; background: #c1d2ee; }
.window .vs-tb:active { background: #98b5e2; }
.vs-tb svg { width: 16px; height: 16px; flex-shrink: 0; }
.vs-sep { width: 1px; height: 18px; background: #aca899; border-right: 1px solid #fff; margin: 0 3px; }
.vs-tb-spacer { flex: 1; }
.vs-project-name { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.vs-project-name .mp-tile { border-radius: 3px; box-shadow: none; }
.vs-project-name:hover span { text-decoration: underline; }
.vs-project-name { color: #555; padding-right: 4px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

.vs-main { flex: 1; min-height: 0; display: flex; gap: 3px; padding: 3px; }
.vs-editor-area { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vs-tabs { display: flex; gap: 1px; flex-shrink: 0; }
.vs-tab {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; cursor: default; user-select: none;
  background: #f4f3ee; border: 1px solid #aca899; border-bottom: 0; color: #444; margin-top: 2px;
}
.vs-tab i { width: 8px; height: 8px; border-radius: 1px; display: inline-block; }
.vs-tab.active { background: #fff; color: #000; margin-top: 0; padding-bottom: 5px; font-weight: bold; position: relative; top: 1px; }
.vs-editor { flex: 1; min-height: 0; display: flex; border: 1px solid #7f9db9; background: #fff; }
.vs-gutter {
  width: 40px; flex-shrink: 0; overflow: hidden; white-space: pre; text-align: right; padding: 4px 6px 4px 0;
  font: 12px/16px "Courier New", Consolas, monospace; color: #2b91af; background: #f7f7f7; border-right: 1px solid #e0e0e0; user-select: none; box-sizing: border-box;
}
.window .vs-code {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; padding: 4px 6px; margin: 0; box-shadow: none;
  font: 12px/16px "Courier New", Consolas, monospace; color: #000; background: #fff; white-space: pre; tab-size: 2;
}
.vs-output { height: 84px; flex-shrink: 0; display: flex; flex-direction: column; border: 1px solid #aca899; background: #fff; }
.vs-pane-title {
  display: flex; align-items: center; gap: 4px; padding: 2px 5px; flex-shrink: 0; font-weight: bold; color: #fff;
  background: linear-gradient(90deg, #0a246a, #a6caf0);
}
.vs-pane-title svg { width: 14px; height: 14px; }
.vs-output-log { flex: 1; overflow: auto; padding: 2px 5px; font: 11px/14px "Courier New", monospace; white-space: pre-wrap; }
.vs-out-line.ok { color: #1a6d0c; }
.vs-out-line.err { color: #c00; }

.vs-ai { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; border: 1px solid #aca899; background: #fff; }
.vs-ai-log { flex: 1; min-height: 0; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 6px; background: #f6f5fb; }
.vs-ai-hint { color: #666; line-height: 1.45; padding: 4px; }
.vs-chat { padding: 5px 7px; line-height: 1.4; border-radius: 3px; max-width: 92%; white-space: pre-wrap; word-wrap: break-word; }
.vs-chat.user { align-self: flex-end; background: #316ac5; color: #fff; }
.vs-chat.ai { align-self: flex-start; background: #fff; border: 1px solid #d3cbe8; color: #222; }
.vs-chat.pending::after { content: ""; display: inline-block; width: 12px; animation: vs-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes vs-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.vs-ai-input { padding: 5px; border-top: 1px solid #d4d0c8; display: flex; flex-direction: column; gap: 4px; background: #ece9d8; }
.window .vs-ai-prompt { width: 100%; box-sizing: border-box; resize: none; font: 11px Tahoma, sans-serif; padding: 3px; }
.vs-ai-go { align-self: flex-end; }

.vs-status { display: flex; justify-content: space-between; padding: 2px 6px; flex-shrink: 0; border-top: 1px solid #aca899; background: #ece9d8; color: #000; }

/* dialogs */
.vs-dlg .np-dialog-body { width: 320px; }
.vs-form { display: flex; flex-direction: column; gap: 8px; }
.vs-form label { display: flex; flex-direction: column; gap: 3px; }
.vs-form label.vs-check { flex-direction: row; align-items: center; gap: 5px; }
.vs-form input:not([type=checkbox]), .vs-form textarea { width: 100%; box-sizing: border-box; font: 11px Tahoma, sans-serif; resize: vertical; }
.vs-dlg-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.vs-open-list { height: 180px; overflow: auto; background: #fff; border: 1px solid #7f9db9; }
.vs-open-item { display: flex; align-items: center; gap: 6px; padding: 3px 5px; cursor: default; user-select: none; }
.vs-open-item img { width: 16px; height: 16px; }
.vs-open-item small { margin-left: auto; color: #888; }
.vs-open-item.sel { background: #316ac5; color: #fff; }
.vs-open-item.sel small { color: #dde; }
.vs-pub-head { display: flex; gap: 10px; align-items: center; line-height: 1.4; }
.vs-pub-head img { width: 40px; height: 40px; }
.vs-pub-icon { display: flex; align-items: center; gap: 10px; line-height: 1.8; }
.vs-pub-icon-prev { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.vs-icon-dlg .np-dialog-body { width: 360px; }
.vs-icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 2px; padding: 4px;
  height: 170px; overflow: auto; background: #fff; border: 1px solid #7f9db9;
}
.vs-icon-opt { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.vs-icon-opt img { width: 32px; height: 32px; }
.vs-icon-opt.sel { background: #c1d2ee; border-color: #316ac5; }
.mp-icon { flex-shrink: 0; display: block; }
.vs-pub-err { color: #c00; min-height: 13px; }

/* ---------- Windows Marketplace ---------- */
.mp-root { background: #fff; }
.mp-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; flex-shrink: 0;
  background: linear-gradient(180deg, #3d7be0 0%, #1d4fb8 60%, #163f96 100%); color: #fff;
}
.mp-brand { display: flex; align-items: center; gap: 8px; font: 20px "Trebuchet MS", Tahoma, sans-serif; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.mp-brand img { width: 34px; height: 34px; }
.mp-brand b { color: #ffcf5c; }
.mp-search { display: flex; gap: 4px; }
.window .mp-search input { width: 180px; font: 11px Tahoma, sans-serif; }
.window .mp-search button { min-width: 36px; }
.mp-nav { display: flex; gap: 2px; padding: 0 10px; flex-shrink: 0; background: linear-gradient(#f1f6fd, #d7e5f8); border-bottom: 1px solid #9db8e0; }
.window .mp-nav button {
  min-width: 0; min-height: 0; padding: 6px 14px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font: bold 11px Tahoma, sans-serif; color: #1d4fb8; border-bottom: 3px solid transparent;
}
.window .mp-nav button:hover { background: rgba(255,255,255,.6); }
.window .mp-nav button.active { border-bottom-color: #f08a00; color: #000; }
.mp-content { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: #f7f9fc; }
.mp-empty { text-align: center; color: #666; padding: 60px 20px; line-height: 1.6; font-size: 12px; }
.mp-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; color: #555; font: 11px Tahoma, sans-serif; }
.window .mp-pagination button { min-width: 66px; font: 11px Tahoma, sans-serif; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mp-card {
  display: flex; gap: 10px; padding: 10px; background: #fff; border: 1px solid #cdd9ea; border-radius: 4px; cursor: pointer; position: relative;
}
.mp-card:hover { border-color: #6a9be6; box-shadow: 0 1px 4px rgba(29,79,184,.2); }
.mp-tile {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 22%; color: #fff;
  font-family: "Trebuchet MS", Tahoma, sans-serif; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -3px 6px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.25);
  position: relative; overflow: hidden;
}
.mp-tile::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48%; background: linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.08)); }
.mp-card-info { flex: 1; min-width: 0; padding-right: 40px; }
.mp-card-name { font-weight: bold; font-size: 12px; color: #1d4fb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card-by { color: #555; margin: 1px 0 3px; }
.mp-card-desc { color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.mp-card-meta { color: #888; margin-top: 3px; }
.window .mp-get { position: absolute; right: 8px; top: 10px; min-width: 44px; min-height: 20px; padding: 0 6px; font: bold 11px Tahoma, sans-serif; }
.mp-detail { max-width: 640px; }
.mp-back { color: #1d4fb8; display: inline-block; margin-bottom: 10px; }
.mp-detail-head { display: flex; gap: 16px; align-items: flex-start; }
.mp-detail-head h2 { margin: 0 0 4px; font: bold 18px "Trebuchet MS", Tahoma, sans-serif; color: #163f96; }
.mp-user { display: inline-flex; align-items: center; gap: 5px; color: #1d4fb8; text-decoration: none; }
.mp-user:hover { text-decoration: underline; }
.mp-user img { width: 18px; height: 18px; border-radius: 2px; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.window .mp-actions button { font: 11px Tahoma, sans-serif; }
.window .mp-actions .mp-btn-primary { font-weight: bold; }
.mp-detail-desc { margin-top: 16px; padding: 10px 12px; background: #fff; border: 1px solid #cdd9ea; border-radius: 4px; line-height: 1.5; white-space: pre-wrap; font-size: 12px; }

@media (max-width: 640px) {
  .vs-main { flex-direction: column; }
  .vs-ai { width: auto; height: 200px; }
  .window .mp-search input { width: 110px; }
  .mp-brand span { display: none; }
}
