:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --panel: #252526;
  --panel-2: #2d2d30;
  --border: #3c3c3c;
  --text: #d4d4d4;
  --muted: #9da3aa;
  --active: #04395e;
  --hover: #2a2d2e;
  --button: #0e639c;
  --button-hover: #1177bb;
  --input: #1b1b1b;
  --danger: #f48771;
  --ok: #89d185;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
}

.login-page {
  min-height: 100vh;
  display: block;
  color: #101820;
  background: #fffaf0;
}

.login-shell {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(392px, 0.84fr);
  overflow: hidden;
}

.login-illustration {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 100vh;
  padding: 0;
  box-sizing: border-box;
  background: #e8f0e6;
  isolation: isolate;
  overflow: hidden;
}

.login-illustration::before {
  position: absolute;
  left: -10vw;
  top: -2vh;
  width: min(39vw, 560px);
  height: 68vh;
  background: #e13b21;
  content: "";
  pointer-events: none;
  z-index: 1;
}

.login-illustration::after {
  position: absolute;
  right: -18vw;
  bottom: -18vh;
  width: min(64vw, 880px);
  height: 62vh;
  background: #fffaf0;
  content: "";
  pointer-events: none;
  z-index: 4;
}

.login-art-panel {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  background: transparent;
  overflow: visible;
}

.login-art-panel::before {
  position: absolute;
  left: 30%;
  top: 0;
  width: min(8vw, 112px);
  height: 100vh;
  background: #101820;
  content: "";
  z-index: 3;
}

.login-art-panel::after {
  position: absolute;
  right: -7%;
  top: 19%;
  width: min(55vw, 760px);
  height: 14vh;
  background: #1769aa;
  content: "";
  z-index: 2;
}

.art-sun {
  position: absolute;
  left: 47%;
  top: 38%;
  width: clamp(92px, 9vw, 142px);
  height: clamp(92px, 9vw, 142px);
  border-radius: 50%;
  background: #f5c542;
  z-index: 5;
}

.art-plane {
  position: absolute;
  content: "";
}

.art-plane-a {
  left: 13%;
  bottom: 15%;
  width: min(43vw, 620px);
  height: 11vh;
  background: #7fa184;
  z-index: 4;
}

.art-plane-b {
  left: 0;
  bottom: 27%;
  width: min(49vw, 690px);
  height: 2.2vh;
  background: #101820;
  z-index: 6;
}

.art-plane-c {
  right: 16%;
  bottom: 0;
  width: min(14vw, 210px);
  height: 28vh;
  background: #e13b21;
  z-index: 5;
}

.art-axis {
  position: absolute;
  height: 1px;
  background: #101820;
  transform-origin: left center;
}

.art-axis-a {
  left: 17%;
  top: 35%;
  width: min(52vw, 760px);
  transform: rotate(-10deg);
  z-index: 6;
}

.art-axis-b {
  left: 42%;
  top: 70%;
  width: min(36vw, 500px);
  transform: rotate(-10deg);
  z-index: 6;
}

.login-panel {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(44px, 7vw, 112px);
  border-left: 0;
  background: #fffaf0;
  box-sizing: border-box;
}

.login-panel::before {
  display: none;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(384px, 100%);
  gap: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-card label {
  display: grid;
  gap: 12px;
  color: #101820;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-card input {
  min-height: 54px;
  padding: 0 0 1px;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: #101820;
  color: #101820;
  background: transparent;
  box-sizing: border-box;
  font-size: 16px;
}

.login-card input:focus {
  border-color: #0e5aa7;
  outline: 0;
}

.login-card button {
  min-height: 56px;
  margin-top: 12px;
  border: 0;
  color: #ffffff;
  background: #101820;
  font-weight: 720;
  box-shadow: none;
}

.login-card button:hover {
  background: #0e5aa7;
}

.login-status {
  min-height: 20px;
  margin: 0;
  color: #59615d;
}

.app-shell {
  display: grid;
  grid-template-rows: 38px 1fr;
  min-width: 980px;
  min-height: 620px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand,
.session-panel,
.login-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mark {
  font-weight: 700;
  color: #ffffff;
}

.runtime,
.session-panel span,
.rooms-pane footer,
.private-pane header span:last-child {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  min-width: 0;
  min-height: 0;
}

.right-stack {
  display: grid;
  grid-template-rows: minmax(230px, 46fr) minmax(260px, 54fr);
  min-width: 0;
  min-height: 0;
}

.pane {
  display: grid;
  grid-template-rows: 35px 1fr auto;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pane header,
.pane footer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  box-sizing: border-box;
}

.pane footer {
  min-height: 34px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.room-list,
.lane,
.artifact-output {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  box-sizing: border-box;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.room-item {
  display: grid;
  grid-template-rows: auto auto;
  width: 100%;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.room-item:hover {
  background: var(--hover);
}

.room-item.is-selected {
  border-color: #1f6aa5;
  background: var(--active);
}

.room-title,
.room-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-meta {
  color: var(--muted);
  font-size: 12px;
}

.message-row {
  margin-bottom: 6px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-row.is-error {
  color: var(--danger);
}

.message-row.is-ok {
  color: var(--ok);
}

.message-compose,
.deploy-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 6px 8px;
}

.deploy-compose {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr);
}

.shared-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(260px, 0.45fr);
  min-width: 0;
  min-height: 0;
}

.shared-grid textarea {
  min-width: 0;
  min-height: 0;
  border-width: 0 0 0 1px;
  border-color: var(--border);
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.artifact-output {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

input,
textarea {
  min-width: 0;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--input);
  box-sizing: border-box;
}

input {
  height: 26px;
  padding: 3px 7px;
}

textarea {
  padding: 7px;
}

button {
  min-height: 26px;
  padding: 2px 10px;
  border: 1px solid transparent;
  color: #ffffff;
  background: var(--button);
}

button:hover {
  background: var(--button-hover);
}

button[data-tab] {
  color: var(--text);
  background: transparent;
}

button[data-tab].is-active,
button[data-tab]:hover {
  background: var(--hover);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  html,
  body,
  #app {
    height: auto;
  }

  .login-page {
    overflow: auto;
  }

  .login-shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .login-illustration {
    display: block;
    min-height: 390px;
    padding: 0;
  }

  .login-illustration::before {
    left: -18%;
    top: -8%;
    width: 58%;
    height: 72%;
  }

  .login-art-panel {
    min-height: 390px;
  }

  .login-panel {
    min-height: auto;
    border-left: 0;
    border-top: 0;
    padding: 38px 28px 48px;
  }

  .app-shell {
    min-width: 0;
    min-height: 100vh;
  }

  .topbar,
  .workspace,
  .shared-grid {
    grid-template-columns: 1fr;
  }

  .login-form,
  .session-panel {
    justify-content: stretch;
  }

  .workspace,
  .right-stack {
    min-height: 960px;
  }
}
