/* Unified Login-Free Browser OS Studio (/linux/, /macos/, /windows/) */
html, body { height: 100%; }
body.bos-body {
  margin: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font, 'Inter Tight', system-ui, -apple-system, sans-serif);
}

.bos-bar {
  flex: none;
  height: 44px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.bos-left { display: flex; align-items: center; gap: 10px; min-width: 0; justify-self: start; }
.bos-brand {
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em;
}

.bos-switcher {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.bos-os-tab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 26px; padding: 0; border-radius: 999px; text-decoration: none;
  color: var(--muted);
  transition: background-color .14s ease, color .14s ease;
}
.bos-os-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.bos-os-tab[aria-current="page"] {
  background: var(--ink); color: var(--bg);
}
.bos-os-ic {
  display: block; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--os) center / contain no-repeat; mask: var(--os) center / contain no-repeat;
}
.bos-os-ic.is-linux { --os: url(./media/os/linux.svg); }
.bos-os-ic.is-macos { --os: url(./media/os/apple.svg); }
.bos-os-ic.is-windows { --os: url(./media/os/windows.svg); width: 13px; height: 13px; }

.bos-right { display: flex; align-items: center; gap: 6px; justify-self: end; }

.bos-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: 500 12px/1 var(--font, inherit);
  text-decoration: none; cursor: pointer; white-space: nowrap; box-sizing: border-box;
  transition: border-color .14s ease, background-color .14s ease;
}
.bos-btn:hover { border-color: var(--ink); background: var(--surface); }
.bos-btn.primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.bos-btn.primary:hover { background: var(--button-hover, var(--ink)); border-color: var(--button-hover, var(--ink)); }

.bos-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bos-stage {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  overflow: hidden;
  background: var(--bg);
}

.bos-tile {
  position: relative;
  width: min(100cqw, 160cqh);
  height: min(100cqh, 62.5cqw);
  border-radius: 10px;
  overflow: hidden;
  background: #0e1116;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bos-tile.is-control {
  box-shadow: 0 0 0 2px var(--ink);
}
.bos-tile canvas {
  display: block; width: 100%; height: 100%; object-fit: contain; outline: none;
  cursor: default;
}
.bos-tile.is-control canvas { cursor: crosshair; }

.bos-cap {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(16, 17, 20, .78); color: #f4f4f2;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px; pointer-events: none;
}
.bos-cap b { font-weight: 600; }
.bos-cap span { opacity: .72; font-family: var(--mono); font-size: 11px; }

.bos-tile-acts {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
}
.bos-icon-btn {
  appearance: none; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(16, 17, 20, .78); color: #f4f4f2;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px; padding: 5px 10px; font: 500 11.5px/1.2 var(--font, inherit);
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.bos-icon-btn:hover { background: rgba(255, 255, 255, .18); }

.bos-take {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  appearance: none; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(14, 15, 18, .86); color: #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px 20px; border-radius: 999px; font: 600 13.5px/1.2 var(--font, inherit);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.bos-tile:hover .bos-take:not([hidden]),
.bos-tile:focus-within .bos-take:not([hidden]) {
  opacity: 1; pointer-events: auto;
}
.bos-take:hover { background: #fff; color: #111; }

.bos-tag {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 4;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(16, 17, 20, .82); color: #f4f4f2;
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(10px); pointer-events: none;
}

.bos-overlay {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 28px; text-align: center;
  background: rgba(12, 14, 18, .84); color: #f4f4f2;
  backdrop-filter: blur(8px);
}
.bos-overlay[hidden] { display: none; }
.bos-overlay img.bos-preview {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .22; filter: blur(3px); pointer-events: none; z-index: -1;
}
.bos-overlay h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.bos-overlay p { margin: 0; max-width: 52ch; font-size: 13.5px; color: rgba(244, 244, 242, .78); line-height: 1.5; }
.bos-prog {
  width: min(280px, 76%); height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .16); overflow: hidden;
}
.bos-prog i {
  display: block; width: 42%; height: 100%; border-radius: 99px; background: #fff;
  animation: bos-slide 1.2s ease-in-out infinite;
}
@keyframes bos-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}
.bos-overlay-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.bos-fallback-iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 7; background: #0e1116;
}

/* Toggleable & Drag-Resizable Bottom Terminal Drawer */
.bos-term {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.bos-term-handle {
  height: 5px; cursor: ns-resize; background: transparent;
}
.bos-term-handle:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.bos-term-bar {
  height: 36px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px;
}
.bos-term-left { display: flex; align-items: center; gap: 10px; }
.bos-term-toggle {
  appearance: none; border: 0; background: none; color: var(--ink);
  font: 600 12.5px/1 var(--font, inherit); display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bos-term-body {
  display: flex; flex-direction: column; height: 210px;
  border-top: 1px solid var(--line); background: #0f1115; color: #e8e9ec;
}
.bos-term-body[hidden] { display: none; }
.bos-term-out {
  flex: 1; margin: 0; padding: 10px 14px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.bos-term-prompt {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-top: 1px solid rgba(255, 255, 255, .1); background: #14171d;
}
.bos-term-prompt span { font-family: var(--mono); color: #7ee787; font-size: 12.5px; }
.bos-term-prompt input {
  flex: 1; background: none; border: 0; outline: none; color: #fff;
  font-family: var(--mono); font-size: 12.5px;
}
.bos-term-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) {
  .bos-pill, .bos-hide-sm { display: none; }
  .bos-bar { padding: 0 12px; }
}
