:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0f14;
  color: #eef3f8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(41, 90, 110, 0.28), transparent 42%),
    linear-gradient(0deg, #0b0f14, #101820);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 420px);
  display: grid;
  gap: 28px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 17, 27, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 8px;
  color: #78d8c8;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #b7c5d3;
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 10px 12px;
  background: #0f1722;
  color: #eef3f8;
  outline: none;
}

input {
  min-height: 44px;
}

input:focus,
textarea:focus {
  border-color: #78d8c8;
  box-shadow: 0 0 0 3px rgba(120, 216, 200, 0.16);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
}

.check-row input {
  min-height: 18px;
  height: 18px;
  padding: 0;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #78d8c8;
  color: #06100f;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #96eadc;
}

.error {
  min-height: 20px;
  margin: 0;
  color: #ff8d8d;
}

.terminal-view {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar h1 {
  font-size: 1.35rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #101a26;
}

.actions span {
  min-width: 112px;
  color: #b7c5d3;
  font-size: 0.9rem;
  text-align: right;
}

.actions button {
  min-height: 36px;
  background: #1a2838;
  color: #eef3f8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.actions .tabs button {
  border: 0;
  background: transparent;
  color: #b7c5d3;
}

.actions .tabs button.active {
  background: #78d8c8;
  color: #06100f;
}

.actions button:hover {
  background: #24384c;
}

.workspace-pane {
  min-height: 0;
}

#terminal {
  min-height: 0;
  height: calc(100vh - 116px);
  padding: 12px;
  overflow: hidden;
}

.xterm {
  height: 100%;
}

.file-workspace {
  height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
}

.file-list-wrap,
.editor {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(9, 17, 31, 0.78);
}

.file-list-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.file-list-header,
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.file-list-header button,
.editor-actions button {
  min-height: 34px;
  background: #1a2838;
  color: #eef3f8;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.file-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.file-row {
  width: 100%;
  display: grid;
  gap: 4px;
  min-height: 0;
  margin: 0 0 6px;
  padding: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #eef3f8;
  text-align: left;
  font-weight: 600;
}

.file-row span {
  overflow-wrap: anywhere;
}

.file-row small {
  color: #94a7ba;
  font-weight: 500;
}

.file-row:hover,
.file-row.selected {
  border-color: rgba(120, 216, 200, 0.5);
  background: #132235;
}

.editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.editor h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.file-root {
  margin: 0 0 4px;
  color: #94a7ba;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-actions span {
  min-width: 74px;
  color: #b7c5d3;
  font-size: 0.9rem;
  text-align: right;
}

#fileEditor {
  min-height: 0;
  height: 100%;
  resize: none;
  border: 0;
  border-radius: 0 0 8px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

.empty {
  margin: 8px;
  color: #b7c5d3;
}

@media (max-width: 680px) {
  .shell {
    padding: 14px;
  }

  .panel {
    padding: 24px;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions span {
    min-width: 0;
    text-align: left;
  }

  #terminal {
    height: calc(100vh - 218px);
    padding: 8px;
  }

  .file-workspace {
    height: auto;
    min-height: calc(100vh - 218px);
    grid-template-columns: 1fr;
  }

  .file-list-wrap {
    max-height: 220px;
  }

  .editor {
    min-height: 56vh;
  }
}
