:root {
  --ps-bg: #012456;
  --ps-white: #cccccc;
  --ps-yellow: #f9f1a5;
  --ps-green: #16c60c;
  --ps-red: #e74856;
  --ps-cyan: #3b78ff;
  --ps-bright-white: #f2f2f2;
  --ps-gray: #767676;
  --ps-dark-bg: #0c0c0c;
}

@font-face {
  font-family: 'Cascadia Mono Fallback';
  src: local('Cascadia Mono'), local('Cascadia Code'), local('Consolas'), local('Courier New');
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  background: var(--ps-bg);
  color: var(--ps-white);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.4;
}

/* Window chrome - title bar */
.window-chrome {
  background: #202020;
  display: flex;
  align-items: flex-end;
  padding: 0;
  height: 46px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-app-region: drag;
}

/* Tab row area */
.window-chrome__tabs {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-left: 8px;
  gap: 0;
  flex-shrink: 0;
}

.window-chrome__tab {
  background: #2d2d2d;
  color: #ccc;
  font-size: 12px;
  font-family: 'Segoe UI', 'Cascadia Code', sans-serif;
  padding: 0 12px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  min-width: 250px;
  cursor: default;
  position: relative;
  -webkit-app-region: no-drag;
}

.window-chrome__tab--active {
  background: var(--ps-bg);
  color: #fff;
}

.window-chrome__tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.window-chrome__tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1;
}

.window-chrome__tab-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #999;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  margin-left: auto;
}

.window-chrome__tab-close:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.window-chrome__tab-close svg {
  width: 9px;
  height: 9px;
}

/* New tab and dropdown buttons */
.window-chrome__actions {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  padding-bottom: 0;
  align-self: center;
}

.window-chrome__action-btn {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
  -webkit-app-region: no-drag;
  align-self: center;
  margin-top: auto;
  margin-bottom: 4px;
}

.window-chrome__action-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.window-chrome__action-btn svg {
  width: 12px;
  height: 12px;
}

/* Spacer to push window controls right */
.window-chrome__spacer {
  flex: 1;
  height: 100%;
  -webkit-app-region: drag;
}

/* Window control buttons */
.window-chrome__controls {
  display: flex;
  gap: 0;
  height: 100%;
  align-items: center;
}

.window-chrome__btn {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: all 0.1s;
  cursor: pointer;
  -webkit-app-region: no-drag;
}

.window-chrome__btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.window-chrome__btn--close:hover {
  background: var(--ps-red);
  color: #fff;
}

/* Terminal content area */
.terminal {
  padding: 16px 20px;
  min-height: calc(100vh - 46px);
}

/* PS prompt styling */
.ps-prompt {
  color: var(--ps-white);
}

.ps-prompt__path {
  color: var(--ps-yellow);
}

.ps-prompt__arrow {
  color: var(--ps-white);
}

.ps-command {
  color: var(--ps-bright-white);
}

.ps-param {
  color: var(--ps-gray);
}

.ps-string {
  color: var(--ps-yellow);
}

.ps-cmdlet {
  color: var(--ps-bright-white);
  font-weight: 600;
}

.ps-property {
  color: var(--ps-white);
}

.ps-value {
  color: var(--ps-bright-white);
}

.ps-comment {
  color: var(--ps-green);
}

.ps-error {
  color: var(--ps-red);
}

/* Pre-formatted table output */
.ps-output {
  margin: 4px 0;
  white-space: pre;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.4;
  font-variant-ligatures: none;
  -webkit-font-feature-settings: "liga" 0, "clig" 0;
  font-feature-settings: "liga" 0, "clig" 0;
}

/* Link styling */
.ps-link {
  color: var(--ps-bright-white);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: all 0.2s;
}

.ps-link:hover {
  color: var(--ps-bright-white);
  background: rgba(59, 120, 255, 0.4);
}

.ps-link--subtle {
  color: var(--ps-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: all 0.2s;
}

.ps-link--subtle:hover {
  color: var(--ps-bright-white);
  text-shadow: none;
}

/* Blinking cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--ps-white);
  animation: blink 1.1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

/* Fade in lines sequentially */
@keyframes fadeInLine {
  from { opacity: 0; }
  to { opacity: 1; }
}

.line {
  opacity: 0;
  animation: fadeInLine 0.2s ease forwards;
}

.l1 { animation-delay: 0.1s; }
.l2 { animation-delay: 0.4s; }
.l3 { animation-delay: 0.7s; }
.l4 { animation-delay: 0.9s; }
.l5 { animation-delay: 1.1s; }
.l6 { animation-delay: 1.3s; }
.l7 { animation-delay: 1.5s; }
.l8 { animation-delay: 1.8s; }
.l9 { animation-delay: 2.0s; }
.l10 { animation-delay: 2.2s; }
.l11 { animation-delay: 2.5s; }
.l12 { animation-delay: 2.8s; }
.l13 { animation-delay: 3.0s; }
.l14 { animation-delay: 3.3s; }
.l15 { animation-delay: 3.6s; }
.l16 { animation-delay: 3.9s; }
.l17 { animation-delay: 4.2s; }

/* Selection */
::selection {
  background: rgba(59, 120, 255, 0.4);
  color: var(--ps-bright-white);
}

/* Startup banner */
.startup-banner {
  color: var(--ps-gray);
  margin-bottom: 16px;
}
