/* Desktops: Linux desktop-environment picker page (#desktops).
   Scope: everything is prefixed with #v-desktops so it cannot leak into the
   rest of the portal. Palette follows the app's dark slate-teal theme. */

#v-desktops {
  --dp-bg: #132229;
  --dp-card: #1b2f38;
  --dp-hover: #233b46;
  --dp-edge: #28414c;
  --dp-accent: #569cd6;
  --dp-mint: #1e4d3b;
  --dp-text: #e4eef2;
  --dp-soft: #a8bfc9;
  --dp-dim: #7f99a4;
  color: var(--dp-text);
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
}

#v-desktops .dp-page {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  height: clamp(560px, calc(100dvh - 180px), 980px);
  border: 1px solid #223a44;
  border-radius: 18px;
  background: var(--dp-bg);
  overflow: hidden;
}

/* ---------------------------------------------------------------- rail */

#v-desktops .dp-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: #112026;
}

#v-desktops .dp-brand {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: linear-gradient(140deg, #569cd6, #1e4d3b);
  color: #08161c;
  font-size: 13px;
  font-weight: 700;
}

#v-desktops .dp-step {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--dp-dim);
  font: 500 10px/1 "Outfit", "Segoe UI", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: default;
}

#v-desktops .dp-step[data-reach="1"] { cursor: pointer; }
#v-desktops .dp-step[data-reach="1"]:hover { color: var(--dp-soft); }
#v-desktops .dp-step.on { color: #eaf3f8; }

#v-desktops .dp-bubble {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(86, 156, 214, 0.22);
  background: #182a32;
  color: #8fb2c0;
  font-size: 12px;
  letter-spacing: 0;
}

#v-desktops .dp-step.on .dp-bubble {
  border-color: var(--dp-accent);
  color: var(--dp-accent);
  box-shadow: 0 0 0 3px rgba(86, 156, 214, 0.12);
}

#v-desktops .dp-step.done .dp-bubble {
  border-color: var(--dp-mint);
  background: var(--dp-mint);
  color: #b7ecd4;
}

/* ---------------------------------------------------------------- main */

#v-desktops .dp-main {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

#v-desktops .dp-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 62% 42%, rgba(86, 156, 214, 0.12), transparent 46%),
    repeating-radial-gradient(
      circle at 62% 42%,
      rgba(160, 205, 230, 0.07) 0 1px,
      transparent 1px 132px
    );
}

#v-desktops .dp-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 30px 0;
}

#v-desktops .dp-title {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #f0f8fb;
}

#v-desktops .dp-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--dp-soft);
}

#v-desktops .dp-crumb {
  font-size: 13px;
  color: #6f8b96;
}
#v-desktops .dp-crumb b { color: #d8e7ee; font-weight: 500; }
#v-desktops .dp-crumb span { color: #7f99a4; padding: 0 4px; }

#v-desktops .dp-head-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

#v-desktops .dp-chip-preview {
  padding: 6px 12px;
  border: 1px solid #2a4550;
  border-radius: 999px;
  font-size: 11px;
  color: var(--dp-dim);
  white-space: nowrap;
}

#v-desktops .dp-chip-preview.live {
  border-color: #2f6a52;
  color: #8ee6b8;
}

#v-desktops .dp-dry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--dp-edge);
  border-radius: 999px;
  background: var(--dp-card);
  color: var(--dp-soft);
  font: 500 12.5px/1 "Outfit", "Segoe UI", sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#v-desktops .dp-dry i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dp-dim);
}
#v-desktops .dp-dry[aria-pressed="true"] {
  border-color: #2d6a52;
  background: rgba(30, 77, 59, 0.55);
  color: #c9f2dd;
}
#v-desktops .dp-dry[aria-pressed="true"] i { background: #8ee6b8; }
#v-desktops .dp-dry:hover { border-color: rgba(86, 156, 214, 0.5); }
#v-desktops .dp-dry[disabled] { opacity: 0.5; cursor: default; }

#v-desktops .dp-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  padding: 0;
  border: 1px solid var(--dp-edge);
  border-radius: 10px;
  background: var(--dp-card);
  color: var(--dp-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#v-desktops .dp-close svg { width: 16px; height: 16px; }
#v-desktops .dp-close:hover {
  border-color: #92403c;
  background: #3a2224;
  color: #ffd9d5;
}

#v-desktops .dp-scroll {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 30px 26px;
  scrollbar-width: thin;
  scrollbar-color: #2b4652 transparent;
}
#v-desktops .dp-scroll::-webkit-scrollbar { width: 9px; }
#v-desktops .dp-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #2b4652;
  background-clip: content-box;
}
#v-desktops .dp-scroll::-webkit-scrollbar-thumb:hover { background: #3a5d6c; background-clip: content-box; }

/* ---------------------------------------------------------------- grid */

#v-desktops .dp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  align-items: start;
  gap: 14px;
}

#v-desktops .dp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--dp-card);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#v-desktops .dp-card:hover { background: var(--dp-hover); }
#v-desktops .dp-card.sel {
  background: var(--dp-hover);
  border-color: var(--dp-accent);
  box-shadow:
    0 0 0 1px rgba(86, 156, 214, 0.5),
    0 14px 30px -20px rgba(86, 156, 214, 0.65);
}
#v-desktops .dp-card.locked { cursor: default; }
#v-desktops .dp-card[aria-disabled="true"] { opacity: 0.55; }
#v-desktops .dp-card:focus-visible {
  outline: 2px solid rgba(86, 156, 214, 0.7);
  outline-offset: 2px;
}

#v-desktops .dp-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

#v-desktops .dp-chip {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #16282f;
  color: var(--dp-dim);
  transition: background 0.15s, color 0.15s;
}
#v-desktops .dp-card:hover .dp-chip { color: var(--dp-soft); }
#v-desktops .dp-card.sel .dp-chip { background: var(--dp-accent); color: #0d1c23; }
#v-desktops .dp-chip svg { width: 16px; height: 16px; }

#v-desktops .dp-card h3 {
  margin: 0;
  overflow: hidden;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #eef6fa;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#v-desktops .dp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--dp-dim);
}

#v-desktops .dp-status {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 500;
}
#v-desktops .dp-status.in-use { background: var(--dp-mint); color: #a9e7c9; }
#v-desktops .dp-status.installed { background: #16272e; color: var(--dp-soft); }

#v-desktops .dp-desc {
  margin: 13px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--dp-soft);
}

#v-desktops .dp-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#v-desktops .dp-extra small {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--dp-soft);
}

#v-desktops .dp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#v-desktops .dp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(40, 65, 76, 0.7);
  border-radius: 6px;
  background: none;
  color: var(--dp-soft);
  font: 500 11px/1 "Outfit", "Segoe UI", sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#v-desktops .dp-pill:hover { border-color: rgba(86, 156, 214, 0.6); color: #dbeaf5; }
#v-desktops .dp-pill.on {
  border-color: var(--dp-accent);
  background: #1f3a4d;
  color: #cfe6f7;
}
#v-desktops .dp-pill svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------------- review */

#v-desktops .dp-review { display: grid; gap: 14px; max-width: 900px; }

#v-desktops .dp-system {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px 16px;
  border: 1px solid var(--dp-edge);
  border-radius: 12px;
  background: rgba(27, 47, 56, 0.6);
  font-size: 12.5px;
  color: var(--dp-soft);
}
#v-desktops .dp-system b { color: #e6f0f5; font-weight: 500; }

#v-desktops .dp-plan-step {
  padding: 14px 16px;
  border: 1px solid var(--dp-edge);
  border-radius: 12px;
  background: var(--dp-card);
}
#v-desktops .dp-plan-step header {
  display: flex;
  align-items: center;
  gap: 9px;
}
#v-desktops .dp-kind {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#v-desktops .dp-kind.repo { background: #24384a; color: #a9cfe8; }
#v-desktops .dp-kind.install { background: #1e4d3b; color: #a9e7c9; }
#v-desktops .dp-kind.remove { background: #4a2a24; color: #f0b6a2; }
#v-desktops .dp-kind.shell { background: #3a2f4a; color: #cdbde8; }
#v-desktops .dp-kind.login { background: #40381f; color: #e8d9a9; }

#v-desktops .dp-plan-step h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #eef6fa;
}
#v-desktops .dp-plan-step p {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--dp-soft);
}

#v-desktops .dp-code {
  margin: 10px 0 0;
  padding: 11px 12px;
  overflow-x: auto;
  border: 1px solid #203741;
  border-radius: 10px;
  background: #0e1c22;
  color: #b9d7e3;
  font: 400 11.5px/1.6 "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
#v-desktops .dp-code::before { content: "$ "; color: #5f8493; }

#v-desktops .dp-notes {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dp-dim);
}

#v-desktops .dp-empty {
  padding: 22px 18px;
  border: 1px dashed #2d4b58;
  border-radius: 12px;
  color: var(--dp-soft);
  font-size: 13px;
}

/* ---------------------------------------------------------------- console */

#v-desktops .dp-console {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  border: 1px solid #203741;
  border-radius: 12px;
  background: #0e1c22;
  overflow: hidden;
}

#v-desktops .dp-console-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid #1b3038;
  background: #102027;
  font-size: 11.5px;
  color: #7f99a4;
}
#v-desktops .dp-console-bar b { color: #cfe0e8; font-weight: 500; }

#v-desktops .dp-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  font: 400 12px/1.65 "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  color: #b9d7e3;
  scrollbar-width: thin;
  scrollbar-color: #2b4652 transparent;
}
#v-desktops .dp-log div { white-space: pre-wrap; word-break: break-word; }
#v-desktops .dp-log .sys { color: #7f99a4; }
#v-desktops .dp-log .step { margin-top: 8px; color: #e6f0f5; font-weight: 500; }
#v-desktops .dp-log .cmd { color: #8ee6b8; }
#v-desktops .dp-log .dry { color: #8ecdf0; }
#v-desktops .dp-log .out { color: #a8bfc9; }
#v-desktops .dp-log .note { color: #cbb891; }
#v-desktops .dp-log .ok { color: #5f8493; }
#v-desktops .dp-log .fail { color: #f0a48f; }
#v-desktops .dp-log .done { margin-top: 8px; color: #8ee6b8; }

/* ---------------------------------------------------------------- done */

#v-desktops .dp-done {
  display: grid;
  max-width: 620px;
  justify-items: start;
  gap: 12px;
  padding: 26px 4px;
}
#v-desktops .dp-done .dp-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--dp-mint);
  color: #b7ecd4;
}
#v-desktops .dp-done .dp-badge.fail { background: #4a2a24; color: #f0b6a2; }
#v-desktops .dp-done h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f0f8fb;
}
#v-desktops .dp-done p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--dp-soft);
}
#v-desktops .dp-done .dp-hint {
  padding: 10px 12px;
  border: 1px solid #2d4b58;
  border-radius: 10px;
  background: rgba(27, 47, 56, 0.6);
  font-size: 12px;
  color: var(--dp-dim);
}

/* ---------------------------------------------------------------- dock */

#v-desktops .dp-dock {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 30px 16px;
}

#v-desktops .dp-count {
  padding: 7px 14px;
  border: 1px solid rgba(40, 65, 76, 0.6);
  border-radius: 999px;
  background: rgba(22, 38, 45, 0.9);
  font-size: 12px;
  font-weight: 500;
  color: var(--dp-soft);
}
#v-desktops .dp-count b { color: #d8e7ee; font-weight: 600; }

#v-desktops .dp-actions { display: flex; align-items: center; gap: 8px; }

#v-desktops .dp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--dp-accent);
  color: #0c1b22;
  font: 600 13.5px/1 "Outfit", "Segoe UI", sans-serif;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s, color 0.15s;
}
#v-desktops .dp-btn:hover { filter: brightness(1.1); }
#v-desktops .dp-btn[disabled] { opacity: 0.4; cursor: not-allowed; filter: none; }
#v-desktops .dp-btn svg { width: 15px; height: 15px; }

#v-desktops .dp-btn.ghost {
  border-color: rgba(40, 65, 76, 0.7);
  background: none;
  color: var(--dp-soft);
  font-weight: 500;
}
#v-desktops .dp-btn.ghost:hover { border-color: rgba(86, 156, 214, 0.5); color: #e6f0f5; filter: none; }

/* ---------------------------------------------------------------- motion */

@keyframes dp-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
#v-desktops .dp-rise { animation: dp-rise 0.28s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  #v-desktops .dp-rise { animation: none; }
}

/* ---------------------------------------------------------------- small */

@media (max-width: 860px) {
  #v-desktops .dp-page {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    border-radius: 14px;
  }
  #v-desktops .dp-rail {
    flex-direction: row;
    justify-content: center;
    gap: 18px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  #v-desktops .dp-brand { display: none; }
  #v-desktops .dp-close { margin: 0; }
  #v-desktops .dp-step { width: auto; font-size: 9px; }
  #v-desktops .dp-bubble { width: 28px; height: 28px; }
  #v-desktops .dp-head { flex-direction: column; padding: 18px 16px 0; }
  #v-desktops .dp-title { font-size: 30px; }
  #v-desktops .dp-scroll { padding: 16px; overflow: visible; }
  #v-desktops .dp-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  #v-desktops .dp-card { padding: 12px; }
  #v-desktops .dp-dock { padding: 10px 16px 14px; }
  #v-desktops .dp-console { min-height: 52vh; }
}
