/* /psstudio — PortalScript Studio Community Edition, in Portalis OS
   (os.css): a toolbar, a black editor sunk into the window, the build
   output docked under it with its own small caption, a status bar in
   segments. the editor is a textarea with transparent text laid over the
   highlighted copy, both in one grid cell so they always share a size, in
   a box that scrolls them together with the gutter. */

.st {
  display: block;
  width: min(980px, calc(100% - 32px));
  margin: 3.4em auto 3em;
}

.st__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--os-sh);
  box-shadow: 0 1px 0 #fff;
}
.st__go { font-weight: bold; }

/* the editor, sunk */
/* clips the tilted watermark, whose corners would otherwise widen the page */
.st__pane {
  position: relative;
  overflow: hidden;
  margin: 4px;
  border: 1px solid;
  border-color: var(--os-dk) #fff #fff var(--os-dk);
  box-shadow: 0 0 0 1px var(--os-sh);
}
.st__edit {
  display: grid;
  grid-template-columns: auto 1fr;
  height: min(26em, 58vh);
  overflow: auto;
  background: #000;
  color: #fff;
  font: 18px/1.25 vtFont, monospace;
  overscroll-behavior: contain;
}
.st__edit::-webkit-scrollbar-track { background: #111; }
.st__gut,
.st__hl,
.st__src {
  margin: 0;
  font: inherit;
  line-height: inherit;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}
.st__gut {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 0.4em 0.5em 0.4em 0.6em;
  min-height: 100%;
  box-sizing: border-box;
  background: #0b1c22;
  border-right: 1px solid #1f3a43;
  color: #4f7480;
  text-align: right;
  user-select: none;
}
.st__gut b { font-weight: normal; }
.st__gut .e { background: #ff4f4f; color: #000; }
.st__gut .w { background: #ffc857; color: #000; }
.st__code { display: grid; min-width: max-content; }
.st__hl,
.st__src {
  grid-area: 1 / 1;
  padding: 0.4em 0.8em 0.4em 0.6em;
  border: 0;
}
.st__src {
  resize: none;
  overflow: hidden;
  background: transparent;
  color: transparent;
  caret-color: var(--os-t3);
  outline: none;
  z-index: 1;
  cursor: text;
}
.st__src::selection { background: rgba(69, 240, 255, 0.3); color: transparent; }

/* highlighting: portalscript.css's colours */
.st__hl .kw { color: #fff; }
.st__hl .p { color: #9a9; }
.st__hl .t { color: #45f0ff; }
.st__hl .u,
.st__hl .n { color: #ffc857; }
.st__hl .s { color: #7dff7d; }
.st__hl .c { opacity: 0.5; }
.st__hl .e { text-decoration: underline wavy #ff4f4f; text-underline-offset: 3px; }
.st__hl .w { text-decoration: underline wavy #ffc857; text-underline-offset: 3px; }
/* past the CE allowance */
.st__hl .over,
.st__hl .over * { color: #444; }

.st__mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  color: #fff;
  opacity: 0.09;
  font: clamp(26px, 6vw, 60px)/1 vtFont, monospace;
  letter-spacing: 0.08em;
  transform: rotate(-12deg);
  overflow: hidden;
}
.st__mark small { font-size: 0.4em; letter-spacing: 0.2em; text-transform: uppercase; }

/* the docked output: a tool window's small caption over a white pane */
.st__dock { margin: 0 4px 4px; border: 1px solid var(--os-sh); background: #fff; }
h2.st__cap {
  display: block;
  margin: 0;
  padding: 2px 8px;
  background: var(--os-gloss) 0 0 / 100% 100% no-repeat, linear-gradient(90deg, #5f7f86, #a9c3c8);
  color: #fff;
  font: bold 11px/1.4 var(--os-ui);
  letter-spacing: 0;
  text-shadow: 1px 1px 0 rgba(0, 20, 30, 0.5);
}
.st__out {
  margin: 0;
  padding: 6px 9px;
  min-height: 6.5em;
  max-height: 14em;
  overflow: auto;
  font: 12px/1.35 "Lucida Console", Consolas, "Courier New", monospace;
  color: var(--os-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.st__out:empty::before { content: "Ready. Build with Build or Ctrl+B."; color: #7d8a88; }
.st__out [data-ln] { cursor: pointer; display: inline-block; }
.st__out [data-ln]:hover { background: var(--os-sel); color: #fff; }
.st__out .e { color: #b00000; }
.st__out .w { color: #7a5a00; }
.st__out .wm { opacity: 0.5; }

.st__fine { margin: 1.2em 0 0; font: 11px/1.4 var(--os-ui); color: rgba(255, 255, 255, 0.6); text-align: center; }
.st__meta { font-size: 12px; color: #5d6b6a; }

/* dialogs: the nag screen, the licence, the questions */
.st-modal__body p.st__splash {
  margin: 10px 0 0;
  padding: 14px 16px 12px;
  background:
    radial-gradient(circle at 92% 120%, rgba(242, 193, 78, 0.45), transparent 45%),
    linear-gradient(120deg, var(--os-t1), var(--os-t2));
  color: #fff;
  font: 30px/1 vtFont, monospace;
  letter-spacing: 0.02em;
}
.st__splash small { display: block; font: bold 11px/1 var(--os-ui); color: var(--os-gold); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 6px; }
.st__ask { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.st__ask .os-field { flex: 1 1 6em; letter-spacing: 0.08em; }

@media (max-width: 560px) {
  .st { width: calc(100% - 16px); margin-top: 3em; }
  /* 16px or more, or iOS zooms in on focus */
  .st__edit { font-size: 16px; height: 52vh; }
  .st__tools .os-tb { padding: 3px 5px; }
  .st__tools .os-sep { display: none; }
  .os-status #st-ed { display: none; }
}
