.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #1e1e1e;
  border-top: thin solid #3c3c3c;
  color: #cccccc;
  overflow: hidden;
}

/* ----- Header: tabs + actions ----- */
.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 0 0.5em 0 0.75em;
  font-family: "Ubuntu", sans-serif;   /* UI text, not code */
  font-size: 0.75em;
  height: 2.5em;
  cursor: pointer;                     /* whole header toggles the panel */
  user-select: none;
}

.panel__tabs {
  display: flex;
  min-width: 0;
  overflow: hidden;
}

.panel__tab {
  padding: 0.7em 0.6em 0.5em;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: rgba(231, 231, 231, 0.6);
  background: none;
  border: none;
  border-bottom: 0.1em solid transparent;
  cursor: pointer;
}

.panel__tab:hover {
  color: #e7e7e7;
}

.panel__tab--active {
  color: #e7e7e7;
  border-bottom-color: #e7e7e7;
}

.panel__actions {
  display: flex;
  flex-shrink: 0;
}

.panel__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25em 0.35em;
  color: inherit;
  background: none;
  border: none;
  border-radius: 0.3em;
  cursor: pointer;
}

.panel__action:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Codicons ship with a fixed 16px size; override with em */
.panel__action .codicon {
  font-size: 1.3em;
}

.panel__action:focus-visible {
  outline: thin solid #007fd4;
}

/* ----- Terminal body ----- */
.terminal {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.4em 1.25em 0.75em;
  font-size: 0.9em;
  line-height: 1.4;
  cursor: text;
  transition:  visibility 0.2s;
}

.terminal__output p {
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__highlight {
  color: #e5e510;
}

/* Output written by panel.js */
.terminal__error {
  color: #f14c4c;
}
.terminal__muted {
  color: rgba(204, 204, 204, 0.55);
}

.terminal__help {
  color: #e5e510;
}

.terminal__link {
  color: #3794ff;
  text-decoration: underline;
}

.terminal__link:hover {
  color: #4daafc;
}

/* ----- Prompt line ----- */
.terminal__line {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.terminal__prompt {
  flex-shrink: 0;
  white-space: nowrap;
}

.terminal__user { color: #23d18b; }
.terminal__path { color: #3b8eea; }

.terminal__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  caret-color: #cccccc;
}
/* ----- Minimize / restore ----- */

/* Checkbox holds the minimized state; hidden but still keyboard-focusable */
.panel-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.panel-toggle:focus-visible ~ .workbench .panel__minimize {
  outline: thin solid #007fd4;
}

/* Smoothly resize the panel row of the workbench grid */
.workbench {
  transition: grid-template-rows 0.2s ease;
}

/* Minimized: panel row shrinks to the header height (2.5em x 0.75 = 1.875em, plus room for the border) */
.panel-toggle:checked ~ .workbench {
  grid-template-rows: 5% 1fr 2em;
}

/* Hide the terminal body so it can't be tabbed into while minimized */
.panel-toggle:checked ~ .workbench .terminal {
  visibility: hidden;
}

/* Swap the icon: minimize when open, restore when minimized */
.panel__minimize .panel__restore-icon {   /* two classes to beat Codicons' display rule */
  display: none;
}

.panel-toggle:checked ~ .workbench .panel__minimize-icon {
  display: none;
}

.panel-toggle:checked ~ .workbench .panel__restore-icon {
  display: inline-block;
}

/* Respect users who turn off animations in their OS */
@media (prefers-reduced-motion: reduce) {
  .workbench,
  .terminal {
    transition: none;
  }
}

/* ----- Medium screens: keep only the TERMINAL tab ----- */
@media (max-width: 64em) {
  .panel__tab--md-hide {
    display: none;
  }
  .panel-toggle:checked ~ .workbench {
  grid-template-rows: 6% 1fr 2em;
}
}

/* ----- Small screens: shorter prompt ----- */
@media (max-width: 40em) {
  .terminal {
    padding: 0.4em 0.75em 0.75em;
  }

  .terminal__prompt-host {
    display: none;
  }
  .panel-toggle:checked ~ .workbench {
    grid-template-rows: 7% 1fr 2em;
  }

  /* Typing on a phone: the keyboard takes half the screen, so give the terminal most of what's left */
  .workbench--typing {
    grid-template-rows: 7% 1fr 70%;
  }
}