/* grasp-terminal.css — the full-page command line panel (King 2026-10-12). */

#grasp-terminal-panel {
  position: fixed;
  inset: 0;
  z-index: 2147483001;              /* above the side-dock rail (its full state covers the page) */
  display: none;
  flex-direction: column;
  background: #0d1117;
  /* keep clear of the notch / home indicator */
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
#grasp-terminal-panel.is-open { display: flex; }

.gt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6edf3;
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  flex: 0 0 auto;
}
.gt-dot { width: 10px; height: 10px; border-radius: 50%; background: #d29922; flex: 0 0 auto; box-shadow: 0 0 6px currentColor; }
.gt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-spacer { flex: 1 1 auto; }
.gt-btn {
  flex: 0 0 auto;
  min-width: 36px; height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px;
  background: rgba(255, 255, 255, 0.06); color: #e6edf3;
  font-size: 15px; cursor: pointer;
}
.gt-btn:active { background: rgba(255, 255, 255, 0.16); }
.gt-end:hover { background: rgba(248, 81, 73, 0.85); border-color: transparent; color: #fff; }

.gt-screen {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 8px;
  background: #0d1117;
}
/* xterm fills the screen area */
#grasp-terminal-panel .xterm { height: 100%; }
#grasp-terminal-panel .xterm-viewport { overflow-y: auto; }

/* Copy / Paste (King 2026-10-17: a phone can't long-press the terminal's screen) */
.gt-word { font-size: 13px; padding: 0 10px; }
.gt-sheet {
  display: none;
  z-index: 2;                       /* over the Enter button */
  flex-direction: column;
  gap: 8px;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 60%;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0));
  background: #161b22;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6edf3;
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.gt-sheet.is-open { display: flex; }
.gt-sheet textarea {
  flex: 1 1 auto;
  min-height: 140px;
  width: 100%;
  box-sizing: border-box;
  background: #0d1117; color: #e6edf3;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px;
  padding: 8px;
  font: 16px/1.35 Menlo, "DejaVu Sans Mono", monospace;   /* 16px: iPhone zooms in on anything smaller */
  -webkit-user-select: text; user-select: text;
}
.gt-sheet-row { display: flex; gap: 8px; align-items: center; }

/* Commands list (King 2026-10-17) */
.gt-menu {
  display: none;
  position: absolute;
  top: calc(53px + env(safe-area-inset-top, 0)); left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 10px calc(16px + env(safe-area-inset-bottom, 0));
  background: #161b22;
  z-index: 2;
}
.gt-menu.is-open { display: block; }
.gt-menu-group {
  margin: 14px 4px 6px;
  color: #8b949e;
  font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.gt-menu-item {
  display: block; width: 100%; text-align: left;
  margin: 0 0 6px; padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); color: #e6edf3;
  font: 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.gt-menu-item:active { background: rgba(124, 92, 255, 0.25); }
.gt-menu-item code {
  display: block; margin-top: 4px;
  color: #7ee787; font: 12px/1.3 Menlo, "DejaVu Sans Mono", monospace;
  white-space: pre-wrap; word-break: break-all;
}
.gt-menu-item code:empty { display: none; }

/* On a phone the buttons need the room; the green dot already says it is live. */
@media (max-width: 420px) { .gt-title { display: none; } }

/* Return key that is always there (King 10-17: a picked command had "no way to send it") */
.gt-enter {
  position: absolute;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  z-index: 1;
  padding: 12px 18px;
  border: 1px solid rgba(124, 92, 255, 0.6); border-radius: 14px;
  background: rgba(124, 92, 255, 0.28); color: #fff;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.gt-enter:active { background: rgba(124, 92, 255, 0.55); }
