/* Existing alternate terminal interface, isolated from the site layout. */
.terminal-launcher{position:fixed;right:max(24px,env(safe-area-inset-right,0px));
  bottom:max(24px,env(safe-area-inset-bottom,0px));z-index:40;display:flex;align-items:center;
  gap:10px;min-height:46px;padding:11px 15px;border:1px solid var(--ink);border-radius:6px;
  background:var(--ink);color:var(--paper);font:12px/1 var(--mono);
  box-shadow:0 2px 8px #00000012;transition:background .15s,border-color .15s}
.terminal-launcher:hover{background:var(--accent);border-color:var(--accent)}
.terminal-launcher svg{flex:none}
.termmode .terminal-launcher{visibility:hidden}
.site-footer{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
#term{position:fixed;inset:0;z-index:60;background:var(--term-bg);color:var(--term-fg);
  font-family:var(--mono);font-size:13.5px;line-height:1.62;display:none;
  flex-direction:column;padding:0}
#term.on{display:flex}
body.termmode{overflow:hidden}

/* The title bar is modelled on the one in macOS Terminal: a slight vertical gradient, a hairline
   highlight along the top edge, the title centred in the bar rather than beside the lights, and
   the lights themselves carrying their glyphs only while the pointer is over the group. */
.term-bar{position:relative;display:flex;align-items:center;padding:0 16px;height:38px;
  background:linear-gradient(#222825,#171C1A);border-bottom:1px solid #050706;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07);flex:0 0 auto;cursor:default;
  user-select:none;-webkit-user-select:none}
.term-bar .t{position:absolute;left:50%;transform:translateX(-50%);color:var(--term-muted);
  font-size:12.5px;letter-spacing:0;font-weight:500;white-space:nowrap;
  max-width:calc(100% - 140px);overflow:hidden;text-overflow:ellipsis}

.term-lights{display:flex;gap:8px;align-items:center;z-index:1}
.lt{width:12px;height:12px;border-radius:50%;border:.5px solid rgba(0,0,0,.28);padding:0;
  cursor:pointer;position:relative;display:block;
  font:700 10px/1 -apple-system,"Segoe UI",system-ui,sans-serif;color:transparent}
.lt.red{background:#FF5F57}
.lt.amber{background:#FEBC2E}
.lt.green{background:#28C840}
.lt::before{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:rgba(0,0,0,.55);opacity:0;transition:opacity .12s ease;font-size:9px;line-height:1}
.lt.red::before{content:"×";font-size:11px}
.lt.amber::before{content:"−"}
.lt.green::before{content:"+";font-size:10px}
.term-lights:hover .lt::before,.lt:focus-visible::before{opacity:1}
.lt:focus-visible{outline:2px solid var(--term-mid);outline-offset:2px}
/* Zoomed: macOS zoom fits the content, which here means a comfortable measure, centred. */
#term.zoom .term-body,#term.zoom .term-entry{max-width:96ch;width:100%;margin:0 auto}

.term-body{flex:1 1 auto;overflow-y:auto;padding:18px 20px 26px;white-space:pre-wrap;
  word-break:break-word;overflow-wrap:anywhere}
.term-body::-webkit-scrollbar{width:9px}
.term-body::-webkit-scrollbar-thumb{background:var(--term-rule);border-radius:5px}

.term-line{margin:0}
.term-in{color:var(--term-fg)}
.term-prompt{color:var(--term-fg)}
.term-path{color:var(--term-mid)}
.term-err{color:var(--term-bright)}
.term-key{color:var(--term-mid)}
.term-dim{color:var(--term-muted)}
.term-head{color:var(--term-bright);font-weight:500}
.term-body a{color:var(--term-fg);border-bottom:1px solid var(--term-rule)}
.term-body a:hover{color:var(--term-bright)}
.term-copy{white-space:normal;max-width:96ch}
.term-copy .term-paragraph,.term-copy .term-head{margin:12px 0}
.term-copy .term-head{margin-top:20px}
.term-copy strong,.term-copy em{color:inherit}
.term-copy code{background:var(--term-panel);color:var(--term-fg);font:inherit}
.term-actions{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:baseline}
.term-command{font:inherit;background:none;border:0;border-bottom:1px solid var(--term-rule);
  color:var(--term-fg);padding:3px 0;cursor:pointer}
.term-command:hover{color:var(--term-bright)}
.term-table{font:inherit;color:inherit;white-space:pre;overflow-x:auto;margin:12px 0}
.term-qr{display:table;margin:10px 0 12px;padding:0;white-space:pre;word-break:normal;
  overflow-wrap:normal;font-family:Consolas,"Liberation Mono",monospace;font-size:14px;
  line-height:1;letter-spacing:0;font-weight:400;font-variant-ligatures:none;
  color:#07110a;background:#c4efd0;text-shadow:none;user-select:all}
@media(max-width:640px){.term-qr{font-size:11px}}
.term-view{max-width:1000px;white-space:normal;margin:14px 0}
.term-view>p{font:12px/1.6 var(--mono);margin-bottom:10px}
.term-ascii-frame{display:block;width:100%;height:560px;border:0;background:var(--term-bg)}

.term-entry{display:flex;gap:8px;padding:2px 20px 20px;align-items:baseline}
.term-entry .term-ps1{flex:0 0 auto;white-space:pre}
#term-input{flex:1 1 auto;background:transparent;border:0;outline:none;color:var(--term-fg);
  font-family:var(--mono);font-size:13.5px;padding:0;caret-color:var(--term-fg);min-width:0}

@media(max-width:640px){
  .terminal-launcher{right:max(16px,env(safe-area-inset-right,0px));bottom:max(16px,env(safe-area-inset-bottom,0px))}
  #term{font-size:12px}
  #term-input{font-size:12px}
  .term-body{padding:14px 14px 20px}
  .term-entry{padding:2px 14px 16px}
}

@media print{.terminal-launcher{display:none!important}.site-footer{padding-bottom:28px}}
