:root {
  --server43: #0f8a5f;
  --green-hot: #28d898;
  --bg: #020806;
  --panel: #04100c;
  --panel-2: #071812;
  --line: #123a2c;
  --text: #e9fff8;
  --terminal-text: #edf9f5;
  --muted: #7fb09f;
  --danger: #ff6f61;
  --nav-h: 54px;
  --cmd-h: calc(88px + env(safe-area-inset-bottom, 0px));
  --drawer-h: min(46vh, 390px);
  --app-h: 100dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-lift: 10px;
  --keyboard-bottom: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  position: fixed;
  width: 100%;
}

body {
  background: #020806;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  background:
    linear-gradient(rgba(15, 138, 95, 0.038) 1px, transparent 1px),
    linear-gradient(180deg, #020806 0%, #04100c 55%, #020806 100%);
  background-size: 100% 19px, auto;
  height: var(--app-h);
  min-height: -webkit-fill-available;
  overflow: hidden;
}

.topbar {
  align-items: center;
  background: rgba(2, 8, 6, 0.96);
  border-bottom: 1px solid rgba(40, 216, 152, 0.2);
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  height: var(--nav-h);
  left: 0;
  padding: 7px 10px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
}

.app-icon {
  border: 1px solid rgba(40, 216, 152, 0.34);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(15, 138, 95, 0.28);
  height: 38px;
  width: 38px;
}

.nav-title {
  color: #ecfff8;
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
}

.nav-title span {
  color: var(--green-hot);
}

.hamburger {
  align-items: center;
  background: rgba(8, 26, 20, 0.92);
  border: 1px solid rgba(40, 216, 152, 0.3);
  border-radius: 8px;
  display: flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.hamburger img {
  height: 24px;
  width: 24px;
}

.workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--cmd-h);
  height: var(--app-h);
  min-height: -webkit-fill-available;
  padding-bottom: var(--bottom-lift);
  padding-top: var(--nav-h);
  transition: padding-bottom 180ms ease;
}

.app-shell.keyboard-open .workspace {
  grid-template-rows: minmax(0, 1fr);
  padding-bottom: calc(var(--cmd-h) + var(--keyboard-bottom));
}

.console-panel {
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
  min-height: 0;
}

.console-status {
  align-items: center;
  background: rgba(4, 16, 12, 0.96);
  border-bottom: 1px solid rgba(15, 138, 95, 0.24);
  color: var(--muted);
  display: flex;
  font-size: 0.68rem;
  font-weight: 850;
  justify-content: space-between;
  min-width: 0;
  padding: 0 10px;
  text-transform: uppercase;
}

.console-tools,
.drawer-tools,
.card-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.micro-button,
.mini-button {
  align-items: center;
  background: rgba(9, 26, 20, 0.94);
  border: 1px solid rgba(40, 216, 152, 0.28);
  border-radius: 7px;
  color: var(--green-hot);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  height: 29px;
  justify-content: center;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
}

.micro-button.primary,
.mini-button.run,
.primary-action,
.command-line button {
  background: var(--server43);
  border-color: var(--server43);
  color: white;
}

.micro-button.primary {
  font-size: 1.08rem;
  width: 32px;
}

.console-output {
  color: var(--terminal-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.35;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.console-entry {
  border-bottom: 1px solid rgba(15, 138, 95, 0.12);
  padding: 8px 0;
}

.console-entry:first-child {
  padding-top: 0;
}

.console-entry.muted {
  color: #86b6a6;
}

.console-entry.pending .entry-meta {
  color: #d6c36a;
}

.console-entry.ok .entry-meta {
  color: #65f2b5;
}

.console-entry.fail .entry-meta,
.stderr {
  color: #ff9f94;
}

.command-row {
  align-items: baseline;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 5px;
}

.command-row code {
  color: #f1fff9;
  font-family: inherit;
  overflow-wrap: anywhere;
}

.prompt {
  color: #65f2b5;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 950;
}

.line {
  margin-bottom: 2px;
}

pre {
  color: #edf9f5;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
}

.entry-meta {
  color: #6e9f8e;
  font-size: 0.62rem;
  margin-top: 6px;
}

.command-line {
  align-items: stretch;
  background: rgba(3, 11, 8, 0.98);
  border-bottom: 10px solid #020806;
  border-top: 1px solid rgba(40, 216, 152, 0.28);
  display: grid;
  gap: 7px;
  grid-template-rows: 36px 32px;
  min-height: var(--cmd-h);
  padding: 8px 9px calc(8px + var(--safe-bottom));
}

.app-shell.keyboard-open .command-line {
  bottom: var(--keyboard-bottom);
  border-bottom-width: 2px;
  left: 0;
  min-height: 78px;
  padding-bottom: 7px;
  position: fixed;
  right: 0;
  z-index: 28;
}

.command-input-row {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.command-line input {
  background: #071812;
  border: 1px solid rgba(40, 216, 152, 0.28);
  border-radius: 7px;
  color: var(--terminal-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  height: 34px;
  min-width: 0;
  outline: none;
  padding: 0 9px;
}

.command-line input:focus {
  border-color: rgba(40, 216, 152, 0.72);
  box-shadow: 0 0 0 2px rgba(15, 138, 95, 0.18);
}

.command-line input:disabled {
  opacity: 0.55;
}

.command-line button {
  border: 1px solid var(--server43);
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 950;
  height: 32px;
  padding: 0 12px;
}

.command-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr 1fr;
}

.command-line .soft-button {
  background: rgba(9, 26, 20, 0.94);
  border-color: rgba(40, 216, 152, 0.28);
  color: var(--green-hot);
}

.button-drawer {
  background: linear-gradient(180deg, rgba(10, 32, 24, 0.99), rgba(3, 13, 9, 0.99));
  border-top: 1px solid rgba(40, 216, 152, 0.36);
  border-radius: 12px 12px 0 0;
  bottom: 0;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.5);
  height: var(--drawer-h);
  left: 0;
  overflow: hidden;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  position: fixed;
  right: 0;
  transform: translateY(100%);
  transition: transform 180ms ease;
  z-index: 20;
}

.app-shell.drawer-open .button-drawer {
  transform: translateY(0);
}

.drawer-handle {
  background: rgba(40, 216, 152, 0.48);
  border-radius: 99px;
  height: 4px;
  margin: 0 auto 8px;
  width: 44px;
}

.drawer-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.eyebrow,
h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  color: var(--green-hot);
  font-size: 0.56rem;
  font-weight: 950;
  text-transform: uppercase;
}

h2 {
  font-size: 0.9rem;
  line-height: 1;
}

.button-grid {
  display: grid;
  gap: 7px;
  max-height: calc(var(--drawer-h) - 66px);
  overflow: auto;
  padding-bottom: 8px;
}

.command-card {
  align-items: center;
  background: rgba(5, 18, 13, 0.92);
  border: 1px solid rgba(40, 216, 152, 0.16);
  border-left: 3px solid var(--accent, var(--server43));
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 55px;
  padding: 8px;
}

.command-card.dragging {
  opacity: 0.55;
}

.card-main {
  min-width: 0;
}

.card-main h3 {
  color: #edfff8;
  font-size: 0.76rem;
  line-height: 1.1;
  margin-bottom: 3px;
}

.card-main code {
  color: #93d9bf;
  display: block;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.61rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-main p {
  color: #6e9f8e;
  font-size: 0.63rem;
  line-height: 1.25;
  margin-top: 4px;
}

.mini-button {
  min-width: 32px;
}

dialog {
  background: #07120e;
  border: 1px solid rgba(40, 216, 152, 0.28);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  color: var(--text);
  max-width: min(520px, calc(100vw - 22px));
  padding: 0;
  width: 520px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.dialog-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.dialog-head,
.dialog-actions {
  align-items: center;
  display: grid;
  gap: 8px;
}

.dialog-head {
  grid-template-columns: 1fr auto;
}

.icon-button {
  background: rgba(9, 26, 20, 0.92);
  border: 1px solid rgba(40, 216, 152, 0.28);
  border-radius: 7px;
  color: var(--green-hot);
  font-size: 1rem;
  font-weight: 900;
  height: 28px;
  line-height: 1;
  width: 28px;
}

label {
  color: #8fd9bd;
  display: grid;
  font-size: 0.68rem;
  font-weight: 900;
  gap: 5px;
}

label input,
label textarea {
  background: #081a13;
  border: 1px solid rgba(40, 216, 152, 0.24);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.76rem;
  padding: 8px 9px;
}

textarea {
  resize: vertical;
}

.color-field {
  width: 110px;
}

.dialog-actions {
  grid-template-columns: auto 1fr auto auto;
}

.dialog-actions button {
  background: rgba(9, 26, 20, 0.92);
  border: 1px solid rgba(40, 216, 152, 0.24);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 900;
  height: 30px;
  padding: 0 10px;
}

.dialog-actions .danger {
  border-color: rgba(255, 111, 97, 0.34);
  color: var(--danger);
}

.confirm-card {
  gap: 12px;
}

.confirm-copy {
  color: #9fcdbd;
  font-size: 0.78rem;
  line-height: 1.35;
}

.confirm-actions {
  grid-template-columns: 1fr auto;
}

.dialog-actions .danger-fill {
  background: rgba(255, 111, 97, 0.14);
  border-color: rgba(255, 111, 97, 0.48);
  color: #ffb1a8;
}

@media (min-width: 860px) {
  :root {
    --drawer-h: min(42vh, 390px);
  }

  .button-drawer {
    left: 50%;
    max-width: 980px;
    right: auto;
    transform: translate(-50%, 100%);
    width: min(980px, calc(100vw - 26px));
  }

  .app-shell.drawer-open .button-drawer {
    transform: translate(-50%, 0);
  }

  .console-output {
    font-size: 0.76rem;
    padding: 12px 14px;
  }
}

@media (max-width: 560px) {
  :root {
    --nav-h: 52px;
    --cmd-h: calc(91px + env(safe-area-inset-bottom, 0px));
    --drawer-h: 48vh;
    --bottom-lift: 12px;
  }

  .console-status {
    font-size: 0.62rem;
    padding: 0 8px;
  }

  .console-tools {
    gap: 4px;
  }

  .micro-button,
  .mini-button {
    font-size: 0.68rem;
    height: 29px;
    padding: 0 9px;
  }

  .console-output {
    font-size: 0.68rem;
    padding: 9px;
  }

  .command-line {
    padding: 8px 8px calc(8px + var(--safe-bottom));
  }

  .app-shell.keyboard-open .command-line {
    padding-bottom: 7px;
  }

  .command-line input {
    font-size: 16px;
  }

  .command-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-actions {
    justify-content: stretch;
  }

  .card-actions .mini-button {
    flex: 1;
  }

  .card-main p {
    display: none;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
