.prop-stage {
  --term-fg: #33ff66;
  --term-bg: #000;
  --term-accent: #33ff66;
  --term-desk: #20242c;
  --term-size: 16px;
  background: var(--term-desk);
  font-family: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas,
               "DejaVu Sans Mono", "Liberation Mono", monospace;
}

.prop-term {
  position: absolute;
  width: 70%;
  height: 70%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.08);
}

.prop-stage[data-layout="max"] .prop-term {
  inset: 0 !important;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.prop-term__bar {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  user-select: none;
  touch-action: none;
}

.prop-term__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prop-term__btns { display: flex; }
.prop-term__btn { position: relative; display: block; }

.prop-term__screen {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.6em 0.8em;
  font-size: var(--term-size);
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.prop-term__line { min-height: 1.35em; }
.prop-term__accent { color: var(--term-accent); font-weight: 700; }

.prop-term__cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--term-fg);
}

.prop-stage[data-cursor="bar"] .prop-term__cursor { width: 2px; }

.prop-stage[data-cursor="underline"] .prop-term__cursor {
  height: 2px;
  vertical-align: baseline;
}

.prop-stage.is-blinking .prop-term.is-focused .prop-term__cursor {
  animation: prop-blink 1.1s steps(1) infinite;
}

.prop-term:not(.is-focused) .prop-term__cursor {
  background: none;
  box-shadow: inset 0 0 0 1px var(--term-fg);
}

@keyframes prop-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .prop-stage .prop-term__cursor { animation: none !important; }
}

.prop-stage[data-style="mac"] .prop-term__bar {
  height: 30px;
  justify-content: center;
  background: #2c2c2e;
  color: #b9b9be;
  font-size: 13px;
  font-weight: 600;
}

.prop-stage[data-style="mac"] .prop-term__btns {
  position: absolute;
  left: 12px;
  gap: 8px;
}

.prop-stage[data-style="mac"] .prop-term__btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.prop-stage[data-style="mac"] .prop-term__btn--close { order: 1; background: #ff5f57; }
.prop-stage[data-style="mac"] .prop-term__btn--min { order: 2; background: #febc2e; }
.prop-stage[data-style="mac"] .prop-term__btn--max { order: 3; background: #28c840; }

.prop-stage[data-style="windows"] .prop-term { border-radius: 8px; }

.prop-stage[data-style="windows"] .prop-term__bar {
  height: 34px;
  justify-content: center;
  background: #1b1b1b;
  color: #e4e4e4;
  font-size: 12px;
}

.prop-stage[data-style="windows"] .prop-term__btns {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
}

.prop-stage[data-style="windows"] .prop-term__btn { width: 46px; }

.prop-stage[data-style="linux"] .prop-term { border-radius: 9px; }

.prop-stage[data-style="linux"] .prop-term__bar {
  height: 38px;
  justify-content: center;
  background: #25282d;
  color: #eceef1;
  font-size: 13px;
  font-weight: 700;
}

.prop-stage[data-style="linux"] .prop-term__btns {
  position: absolute;
  right: 10px;
  gap: 8px;
}

.prop-stage[data-style="linux"] .prop-term__btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
}

.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn::before,
.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  color: inherit;
}

.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--min::before {
  width: 10px;
  border-top: 1px solid currentColor;
}

.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--max::before {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
}

.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--close::before,
.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--close::after {
  width: 13px;
  border-top: 1px solid currentColor;
  rotate: 45deg;
}

.prop-stage:is([data-style="windows"], [data-style="linux"]) .prop-term__btn--close::after {
  rotate: -45deg;
}

.prop-stage:is([data-style="console"], [data-style="none"]) .prop-term__bar { display: none; }
.prop-stage:is([data-style="console"], [data-style="none"]) .prop-term:not(.is-focused) { display: none; }

.prop-alert {
  position: absolute;
  inset: 0;
  z-index: 100000;
  display: none;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
}

.prop-alert.is-visible { display: grid; }

.prop-alert span {
  padding: 0.6em 1.2em;
  border: 0.08em solid currentColor;
  background: rgb(0 0 0 / 0.88);
  color: #3dff7a;
  font-size: clamp(1.75rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.prop-alert[data-kind="denied"] span { color: #ff3b3b; }
