:root {
  --black: #151515;
  --panel: #282a36;
  --panel2: #202124;
  --line: #3b3d45;
  --muted: #afb2bd;
  --cream: #f8f8f2;
  --accent: #bd19e6;
  --red: #ff5c57;
  --mono: "DM Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: #111;
  color: var(--cream);
  font-family: var(--sans);
}
button,
input,
textarea,
select {
  font: inherit;
}
.studio-shell {
  min-height: 100vh;
  padding: 10px;
}
.studio-topbar,
.studio-toolbar {
  border: 1px solid var(--line);
  background: var(--panel2);
}
.studio-topbar {
  height: 43px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  gap: 18px;
  border-radius: 8px 8px 0 0;
}
.studio-mark {
  color: var(--cream);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -1px;
  text-decoration: none;
}
.studio-mark span {
  font-weight: 400;
}
.studio-mark i {
  width: 5px;
  height: 5px;
  background: #50fa7b;
  border-radius: 50%;
  display: inline-block;
  margin: 0 0 2px 3px;
}
.project-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-control label,
.save-state,
.studio-note {
  font: 10px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-control input {
  color: var(--cream);
  width: 150px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  padding: 4px 0;
}
.project-control input:focus {
  border-color: #bd93f9;
}
.save-state {
  margin: 0;
}
.save-state.is-error {
  color: #ff6b6b;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}
.text-button,
.quiet-button,
.icon-button,
.panel-open {
  color: var(--cream);
  background: none;
  border: 0;
  cursor: pointer;
  font: 10px var(--mono);
  text-transform: uppercase;
}
.text-button:hover,
.quiet-button:hover,
.icon-button:hover {
  color: #bd93f9;
}
.account-button,
.run-button {
  border: 0;
  cursor: pointer;
  font: 500 10px var(--mono);
  text-transform: uppercase;
}
.account-button {
  color: #171717;
  background: var(--cream);
  padding: 8px 11px;
  border-radius: 3px;
  text-decoration: none;
}
.report-button:hover {
  background: #ffb7f4;
}
.sign-in-panel {
  border: 1px solid var(--line);
  border-top: 0;
  background: #1d1e22;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 30px;
}
.sign-in-panel.is-open {
  display: flex;
}
.panel-kicker {
  color: #50fa7b;
  font: 10px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sign-in-panel h1 {
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1;
  margin: 9px 0;
  letter-spacing: -0.05em;
}
.sign-in-panel p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}
.provider-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.provider-button {
  border: 1px solid #565963;
  color: var(--cream);
  padding: 11px 13px;
  text-decoration: none;
  font: 11px var(--mono);
}
.provider-button:hover {
  border-color: #bd93f9;
}
.google-mark {
  color: #50fa7b;
  font: 700 16px var(--sans);
  margin-right: 7px;
}
.github-mark {
  font-size: 18px;
  margin-right: 6px;
}
.quiet-button {
  padding: 10px;
  color: var(--muted);
}
.studio-toolbar {
  border-top: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 7px 12px;
  gap: 14px;
}
.file-actions,
.toolbar-right,
.closed-panels {
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-actions label {
  font: 10px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
}
.file-actions select {
  max-width: 150px;
  background: #151619;
  color: var(--cream);
  border: 1px solid #454852;
  padding: 6px;
  font: 11px var(--mono);
}
.icon-button {
  padding: 7px;
}
.panel-open {
  border: 1px solid #454852;
  padding: 6px 9px;
  border-radius: 3px;
  color: #aeb3c2;
}
.panel-open.is-hidden {
  display: none;
}
.device-switch {
  border: 1px solid #4d4d52;
  display: flex;
}
.device-switch button {
  background: transparent;
  border: 0;
  border-right: 1px solid #4d4d52;
  color: var(--muted);
  padding: 6px 8px;
  font: 9px var(--mono);
  cursor: pointer;
}
.device-switch button:last-child {
  border: 0;
}
.device-switch .is-active {
  color: var(--cream);
  background: #393b43;
}
.run-button {
  color: #fff;
  background: #bd19e6;
  padding: 9px 17px;
  border-radius: 3px;
}
.editor-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr)) minmax(320px, 1.45fr);
  height: calc(100vh - 136px);
  min-height: 470px;
  border: 1px solid var(--line);
  border-top: 0;
  transition: grid-template-columns 0.2s;
}
.editor-layout.all-panels-closed {
  grid-template-columns: 1fr !important;
}
.editor-layout.all-panels-closed .preview-area {
  grid-column: 1 / -1;
}
.code-panel,
.preview-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 4px solid #22242b;
}
.code-panel header,
.preview-area header {
  height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: #e7e9ef;
  font: 10px var(--mono);
}
.code-panel[data-panel="html"] header {
  border-top: 2px solid #ff5555;
}
.code-panel[data-panel="css"] header {
  border-top: 2px solid #6272a4;
}
.code-panel[data-panel="javascript"] header {
  border-top: 2px solid #f1fa8c;
}
.code-panel header b {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  display: inline-block;
}
.html-dot {
  background: #ff5555;
}
.css-dot {
  background: #6272a4;
}
.js-dot {
  background: #f1fa8c;
}
.panel-toggle {
  background: transparent;
  color: #aeb3c2;
  border: 0;
  cursor: pointer;
  font-size: 17px;
}
.code-stack {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.code-editor,
.code-editor .cm-editor {
  height: 100%;
}
.code-editor .cm-editor {
  background: var(--panel);
  color: var(--cream);
  font: 12px/1.65 var(--mono);
}
.code-editor .cm-scroller,
.code-editor .cm-content,
.code-editor .cm-gutter {
  font-family: var(--mono);
}
.code-editor .cm-gutters {
  background: var(--panel);
  border-right: 1px solid var(--line);
  color: #737990;
}
.code-editor .cm-activeLine,
.code-editor .cm-activeLineGutter {
  background: #323440;
}
.code-editor .cm-cursor {
  border-left: 2px solid #50fa7b;
}
.code-editor .cm-selectionBackground,
.code-editor .cm-focused .cm-selectionBackground {
  background: #44475a !important;
}
.code-panel.is-closed {
  display: none;
}
.preview-area {
  border: 0;
  background: #fff;
}
.preview-area header {
  background: #202124;
  color: #e7e9ef;
  border-top: 2px solid #50fa7b;
}
.preview-dot {
  width: 7px;
  height: 7px;
  background: #50fa7b;
  border-radius: 50%;
}
.preview-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: auto;
  padding: 0;
  background: #fff;
}
#preview {
  width: 100%;
  border: 0;
  background: #fff;
  transition: width 0.2s;
}
.preview-stage.tablet #preview {
  width: 768px;
}
.preview-stage.mobile #preview {
  width: 390px;
}
.studio-note {
  margin: 8px 2px 0;
  text-align: right;
}
.studio-note code {
  color: #bd93f9;
  text-transform: none;
}
@media (max-width: 1000px) {
  .editor-layout {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    height: auto;
  }
  .code-panel {
    height: 300px;
  }
  .preview-area {
    grid-column: 1/-1;
    height: 55vh;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 700px) {
  .studio-shell {
    padding: 0;
  }
  .studio-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }
  .file-actions,
  .closed-panels,
  .toolbar-right {
    min-width: 0;
  }
  .file-actions {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    width: 100%;
    max-width: 100%;
  }
  .closed-panels {
    width: 100%;
    max-width: 100%;
  }
  .toolbar-right {
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
  }
  .studio-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand status"
      "project project"
      "actions actions";
    height: auto;
    min-height: 43px;
    gap: 10px 12px;
    padding: 10px 12px;
  }
  .studio-mark {
    grid-area: brand;
    min-width: 0;
    font-size: 15px;
    white-space: nowrap;
  }
  .project-control {
    grid-area: project;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
  }
  .project-control input {
    width: 100%;
    min-width: 0;
  }
  .save-state {
    grid-area: status;
    font-size: 9px;
    text-align: right;
  }
  .top-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }
  .text-button {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 3px;
    text-align: center;
  }
  .sign-in-panel {
    padding: 24px;
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar-right {
    gap: 6px;
  }
  .editor-layout {
    display: flex;
    flex-direction: column;
  }
  .code-panel {
    height: 250px;
    flex: none;
    border-bottom: 1px solid var(--line);
  }
  .code-panel.is-closed {
    display: none;
  }
  .preview-area {
    height: 55vh;
    flex: none;
  }
  .editor-layout.all-panels-closed {
    height: calc(100vh - 136px);
    min-height: 0;
  }
  .editor-layout.all-panels-closed .preview-area {
    flex: 1;
    height: auto;
  }
  .file-actions select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .device-switch button {
    padding: 6px;
  }
  .studio-note {
    padding: 0 12px;
    text-align: left;
  }
}
@media (max-width: 700px) {
  .code-editor .cm-editor {
    font-size: 14px;
  }
  .code-editor .cm-gutters {
    font-size: 12px;
  }
}
