/* The terminal lives in the browser's top layer. Its row list scrolls independently. */
.bc-terminal-host [hidden] { display: none !important; }
.bc-terminal {
  --bc-bg: #101719; --bc-surface: #172023; --bc-line: #344347;
  --bc-text: #f0f1e8; --bc-muted: #b1c0bf; --bc-cyan: #86e4d5; --bc-amber: #f8be79;
  position: fixed;
  inset: auto;
  top: var(--bc-center-y,50%);
  left: var(--bc-center-x,50%);
  transform: translate(-50%,-50%);
  width: min(712px,calc(var(--bc-visible-width,100vw) - 24px));
  max-width: none;
  max-height: calc(var(--bc-visible-height,100dvh) - 24px);
  padding: 0;
  margin: 0;
  overflow: hidden;
  color: var(--bc-text);
  border: 1px solid #5a7375;
  border-radius: 7px;
  background: var(--bc-bg);
  box-shadow: 0 16px 80px #000b, 0 0 0 1px #0c1011;
}
.bc-terminal[open] { display: flex; flex-direction: column; }
.bc-terminal::backdrop { background: #080c0edc; backdrop-filter: blur(4px); }
.bc-pad-terminal {
  --bc-bg: #0b1710; --bc-surface: #0f2016; --bc-line: #3c664a;
  --bc-text: #d0e8c5; --bc-muted: #a2bea1; --bc-cyan: #9cdb9e; --bc-amber: #f6cd82;
  --body: var(--mono); --display: var(--mono);
  height: min(650px,calc(var(--bc-visible-height,100dvh) - 24px));
  border: 1px solid #9bc99d; border-radius: 0;
  box-shadow: 0 0 0 2px #102316, 0 0 0 3px #486d50, 0 14px 60px #000a;
  font: 400 .875rem/1.35 var(--mono);
}
.bc-terminal :is(button,a) { touch-action: manipulation; }
.bc-terminal button { text-align: left; }
.bc-terminal :is(button,input,select,a):focus-visible { outline: 2px solid var(--bc-cyan); outline-offset: -2px; }
.bc-terminal button:disabled { cursor: default; }
.bc-terminal-head {
  display: flex; flex: none; align-items: center; gap: 9px;
  min-height: 56px; padding: 5px 12px 5px 16px;
  border-top: 2px solid var(--bc-cyan); border-bottom: 1px solid var(--bc-line);
  background: linear-gradient(100deg,#203032,#192326 72%);
}
.bc-console-icon,.bc-listen-icon,.bc-row-play,.bc-type-icon {
  display: inline-grid; place-items: center; flex: none; color: var(--bc-cyan);
}
.bc-console-icon { width: 29px; height: 29px; border: 1px solid #6eaca5; border-radius: 4px; }
.bc-console-icon svg { width: 18px; height: 18px; }
.bc-terminal h2,.bc-terminal h3,.bc-terminal p { margin: 0; }
.bc-terminal-head h2 { color: var(--bc-text); font: 700 1.65rem/.98 var(--display); }
.bc-address {
  margin-left: 2px; padding: 3px 7px; min-width: 40px; text-align: center;
  color: var(--bc-amber); border: 1px solid #896d49; border-radius: 2px;
  font: 500 .86rem/1.1 var(--mono);
}
.bc-close,.bc-back {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 42px;
  border-radius: 3px; color: #ccdad6; background: transparent;
}
.bc-close { margin-left: auto; }
.bc-close svg { width: 21px; height: 21px; }
.bc-back svg { width: 17px; height: 17px; }
.bc-close:hover,.bc-back:hover { background: #354247; }
/* The pad browser uses the same local IBM Plex Mono face on every control. */
.bc-pad-terminal .bc-terminal-head {
  padding: 0 7px 0 12px; min-height: 48px; gap: 9px;
  border: 0; border-bottom: 1px solid #5e8d65; color: #102318; background: #acd1a8;
}
.bc-pad-terminal .bc-terminal-head h2 { color: #102318; font: 500 1.08rem/1.1 var(--mono); letter-spacing: .055em; text-transform: uppercase; }
.bc-pad-terminal .bc-console-icon {
  width: 27px; height: 23px; border: 0; border-radius: 0; color: #b7e5b3; background: #203b28;
}
.bc-pad-terminal .bc-console-icon svg { width: 16px; height: 16px; }
.bc-pad-terminal .bc-address {
  margin-left: auto; min-width: 0; padding: 2px 6px; border: 0; border-radius: 0;
  background: #233629; color: var(--bc-amber); font: 500 .86rem/1.25 var(--mono);
}
.bc-pad-terminal .bc-close { margin: 0; border-radius: 0; width: 44px; height: 44px; color: #173521; }
.bc-pad-terminal .bc-close:hover { color: #e4f4dc; background: #42634a; }
.bc-pad-terminal .bc-close:focus-visible { outline-color: #173521; }
.bc-installed {
  display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 13px; border-bottom: 1px solid #34563e; background: #102016;
}
.bc-current {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 46px; padding: 1px 2px; color: var(--bc-text);
}
.bc-listen-icon,.bc-row-play,.bc-folder-icon { display: inline-grid; place-items: center; flex: none; color: var(--bc-cyan); }
.bc-listen-icon { width: 25px; height: 25px; border: 1px solid #739577; }
.bc-listen-icon svg,.bc-row-play svg { width: 10px; height: 10px; }
.bc-current > span:last-child { display: grid; min-width: 0; gap: 1px; }
.bc-current small,.bc-stage-head > span,.bc-dir-mark,.bc-type small,.bc-trial-info > span,.bc-row-copy small,.bc-current-source {
  color: var(--bc-muted); font: 400 .73rem/1.25 var(--mono);
}
.bc-current small { font-size: .67rem; text-transform: uppercase; letter-spacing: .055em; }
.bc-current strong { font: 500 .89rem/1.22 var(--mono); overflow-wrap: anywhere; }
.bc-current-source { font-size: .72rem; }
.bc-example,.bc-download { color: var(--bc-amber); text-decoration: underline; text-underline-offset: .2em; font: 600 .87rem/1.2 var(--body); }
.bc-restore { min-height: 44px; max-width: 104px; padding: 3px 5px; flex: none; color: var(--bc-amber); text-decoration: underline; text-underline-offset: .2em; font: 500 .77rem/1.2 var(--mono); }
.bc-path {
  display: flex; align-items: center; gap: 5px; flex: none; min-width: 0; padding: 0 9px;
  color: var(--bc-text); background: #0b1710; border-bottom: 1px solid var(--bc-line);
}
.bc-directories { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 0; min-width: 0; }
.bc-path-part,.bc-root { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.bc-directories button,.bc-directories [aria-current],.bc-slash {
  min-width: 0; color: #c1ddba; font: 400 .79rem/1.2 var(--mono);
}
.bc-directories button { min-height: 44px; padding: 0 1px; background: transparent; border-radius: 0; }
.bc-directories button:not(:disabled) { text-decoration: underline; text-decoration-color: #6f9774; text-underline-offset: 3px; }
.bc-directories button:not(:disabled):hover { color: #edffdf; }
.bc-directories button:disabled,.bc-directories [aria-current="page"] { color: #d9edcb; }
.bc-drive { color: var(--bc-amber); font-weight: 500; }
.bc-slash { flex: none; color: #85aa86; }
.bc-back {
  display: inline-flex; gap: 3px; justify-content: center; width: auto; min-width: 44px; height: 44px;
  padding: 0 3px; border-radius: 0; color: #abd0a8; font: 500 .72rem/1 var(--mono);
}
.bc-back svg { width: 13px; height: 13px; }
.bc-back:hover { background: #243c29; color: #e5f6de; }
.bc-stage-head { display: flex; flex: none; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 13px 6px; }
.bc-stage-head h3 { outline: none; color: var(--bc-cyan); font: 500 .9rem/1.2 var(--mono); }
.bc-stage-head > span { flex: none; }
.bc-stage-scroll {
  flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain;
  margin: 0 11px 11px; border: 1px solid var(--bc-line); scrollbar-color: #638a66 #102016;
}
.bc-choice-list { display: grid; align-content: start; }
.bc-factions,.bc-types { grid-template-columns: repeat(2,minmax(0,1fr)); }
.bc-sounds { grid-template-columns: minmax(0,1fr); }
.bc-choice {
  width: 100%; min-width: 0; border: 0; border-bottom: 1px solid #294331; border-radius: 0;
  color: var(--bc-text); background: #102016; overflow-wrap: anywhere;
}
.bc-choice:hover { color: #e7f4d7; background: #1c3523; }
.bc-choice > strong,.bc-row-copy strong { min-width: 0; font: 500 .86rem/1.23 var(--mono); }
.bc-faction,.bc-type { display: grid; align-items: center; column-gap: 8px; min-height: 46px; padding: 4px 9px; }
.bc-factions .bc-choice:nth-child(odd),.bc-types .bc-choice:nth-child(odd) { border-right: 1px solid var(--bc-line); }
.bc-faction { grid-template-columns: 17px minmax(0,1fr) auto auto; }
.bc-type { grid-template-columns: 17px minmax(0,1fr) auto; }
.bc-folder-icon { color: #9ad89a; }
.bc-folder-icon svg { width: 17px; height: 17px; }
.bc-dir-mark,.bc-type small { white-space: nowrap; text-align: right; font-size: .68rem; color: #a3bd9e; }
.bc-portrait { display: block; width: 36px; height: 24px; object-fit: contain; object-position: center; filter: grayscale(1) sepia(.45) hue-rotate(65deg) contrast(1.12); }
.bc-sound { display: flex; gap: 10px; align-items: center; min-height: 47px; padding: 6px 10px; }
.bc-row-play { width: 19px; height: 22px; color: #a5cc9d; }
.bc-row-copy { display: grid; gap: 2px; min-width: 0; }
.bc-wave { flex: none; margin-left: auto; color: #7eae87; width: 65px; height: 21px; }
.bc-wave path { fill: none; stroke: currentColor; stroke-width: 1.4; shape-rendering: crispEdges; }
.bc-pad-terminal .bc-sound[aria-pressed="true"] { color: #102216; background: #a4d6a0; }
.bc-sound[aria-pressed="true"] .bc-row-copy small,.bc-sound[aria-pressed="true"] .bc-wave { color: #273f29; }
.bc-sound[aria-pressed="true"] .bc-row-play { color: #d9f0cf; background: #25452c; }
.bc-pad-terminal .bc-choice[aria-pressed="true"]:focus-visible { outline-color: #17341b; }
.bc-empty { padding: 12px; color: var(--bc-muted); font: .85rem var(--mono); }
.bc-terminal-foot {
  flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px 14px;
  min-width: 0; padding: 8px 12px; border-top: 1px solid var(--bc-line); background: #132418;
}
.bc-trial-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 185px; }
.bc-trial-info strong { overflow-wrap: anywhere; font: 500 .85rem/1.2 var(--mono); }
.bc-trial-info > span { font-size: .73rem; line-height: 1.23; overflow-wrap: anywhere; }
.bc-ineligible .bc-trial-info > span { color: var(--bc-amber); }
.bc-confirm { display: flex; justify-content: flex-end; gap: 6px; margin-left: auto; }
.bc-plain,.bc-assign {
  display: inline-grid; align-content: center; min-height: 44px; padding: 7px 12px; border-radius: 3px;
  border: 1px solid #4a5b5e; background: #263235; color: var(--bc-text); font: 600 .94rem/1.17 var(--body);
}
.bc-pad-terminal .bc-confirm button {
  min-height: 44px; padding: 7px 12px; border: 1px solid #698f6d; border-radius: 0; color: #c4dfbd;
  background: #172a1b; font: 500 .83rem/1.15 var(--mono);
}
.bc-pad-terminal .bc-confirm .bc-assign { background: var(--bc-amber); color: #242113; border-color: #f4cd82; }
.bc-pad-terminal .bc-confirm .bc-assign:focus-visible { outline-color: #2b351e; }
.bc-pad-terminal .bc-confirm .bc-assign:disabled { opacity: 1; background: #233226; border-color: #536859; color: #a2b2a1; }
.bc-pad-terminal .bc-confirm .bc-assign:not(:disabled):hover { background: #ffe2a9; }
.bc-terminal .bc-file-button:disabled,.bc-plain:disabled { opacity: .5; }
.bc-kits-terminal { width: min(470px,calc(var(--bc-visible-width,100vw) - 24px)); }
.bc-kits-body { overflow: auto; overscroll-behavior: contain; min-height: 0; display: grid; gap: 12px; padding: 15px; }
.bc-kit-line { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; margin: 0; }
.bc-kit-line label { display: grid; gap: 4px; color: var(--bc-muted); font: 500 .82rem var(--mono); }
.bc-kit-line :is(input,select) {
  display: block; width: 100%; min-width: 0; height: 44px; padding: 6px 8px;
  color: var(--bc-text); background: #1b2629; border: 1px solid #516365; border-radius: 3px;
  font: 600 1rem var(--body);
}
.bc-export-title { padding-top: 12px; border-top: 1px solid var(--bc-line); font: 700 1.27rem/1 var(--display); }
.bc-file-button {
  width: 100%; min-height: 51px; padding: 9px 10px; display: flex; align-items: center; gap: 10px;
  border: 1px solid #415357; border-radius: 3px; color: var(--bc-text); background: #1c282b;
}
.bc-file-button > span:first-child svg { width: 20px; height: 20px; color: var(--bc-cyan); }
.bc-file-button > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.bc-file-button strong { font: 600 1rem/1.14 var(--body); }
.bc-file-button small,.bc-preset-guide,.bc-export-progress > span { color: var(--bc-muted); font: 400 .84rem/1.2 var(--body); }
.bc-file-button i svg { width: 16px; height: 16px; }
.bc-native { background: #243530; border-color: #56847a; }
.bc-native > span:first-child svg { color: #a5e9d8; }
.bc-terminal .bc-preset-guide { margin: 6px 2px 0; }
.bc-preset-guide code { color: #c8ddd7; overflow-wrap: anywhere; font: 400 .78rem/1.25 var(--mono); }
.bc-download,.bc-example { display: inline-flex; align-items: center; align-self: flex-start; min-height: 38px; justify-self:start; padding: 0 2px; }
.bc-example { color: var(--bc-cyan); }
.bc-export-progress { display: grid; gap: 5px; }
.bc-export-progress progress { width: 100%; height: 7px; accent-color: var(--bc-cyan); }

@media (max-width: 560px) {
  .bc-terminal { width: calc(var(--bc-visible-width,100vw) - 14px); max-height: calc(var(--bc-visible-height,100dvh) - 14px); }
  .bc-pad-terminal { height: min(650px,calc(var(--bc-visible-height,100dvh) - 14px)); }
  .bc-terminal-head { min-height: 50px; padding-inline: 10px 5px; }
  .bc-pad-terminal .bc-terminal-head { min-height: 46px; }
  .bc-installed { padding: 4px 8px; }
  .bc-path { padding-inline: 7px 4px; }
  .bc-stage-head { padding: 9px 9px 6px; }
  .bc-stage-scroll { margin-inline: 6px; margin-bottom: 7px; }
  .bc-factions { grid-template-columns: minmax(0,1fr); }
  .bc-faction { column-gap: 7px; padding-inline: 8px; }
  .bc-factions .bc-choice:nth-child(odd) { border-right: 0; }
  .bc-type { grid-template-columns: 15px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 6px; padding: 5px 7px; }
  .bc-type .bc-folder-icon { grid-row: 1 / 3; }
  .bc-type small { grid-column: 2; text-align: left; }
  .bc-terminal-foot { padding: 7px 8px; gap: 5px; }
  .bc-trial-info { flex-basis: 100%; }
  .bc-confirm { width: 100%; }
  .bc-confirm .bc-assign { justify-content: center; min-width: 132px; }
  .bc-wave { width: 42px; }
}
@media (max-height: 490px) and (min-width: 450px) {
  .bc-terminal-head { min-height: 39px; padding-block: 0; }
  .bc-close { height: 36px; }
  .bc-pad-terminal .bc-terminal-head { min-height: 39px; }
  .bc-installed { padding-block: 2px; }
  .bc-current-source { display: none; }
  .bc-stage-head { padding-block: 5px; }
  .bc-terminal-foot { flex-wrap: nowrap; padding-block: 3px; }
  .bc-trial-info { flex-basis: 150px; }
  .bc-confirm { width: auto; }
}
@media (forced-colors: active) {
  .bc-pad-terminal .bc-sound[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
}
