/* node_modules/@xterm/xterm/css/xterm.css */
.xterm {
  cursor: text;
  position: relative;
  user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
}
.xterm.focus,
.xterm:focus {
  outline: none;
}
.xterm .xterm-helpers {
  position: absolute;
  top: 0;
  z-index: 5;
}
.xterm .xterm-helper-textarea {
  padding: 0;
  border: 0;
  margin: 0;
  position: absolute;
  opacity: 0;
  left: -9999em;
  top: 0;
  width: 0;
  height: 0;
  z-index: -5;
  white-space: nowrap;
  overflow: hidden;
  resize: none;
}
.xterm .composition-view {
  background: #000;
  color: #FFF;
  display: none;
  position: absolute;
  white-space: nowrap;
  z-index: 1;
}
.xterm .composition-view.active {
  display: block;
}
.xterm .xterm-viewport {
  background-color: #000;
  overflow-y: scroll;
  cursor: default;
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
}
.xterm .xterm-screen {
  position: relative;
}
.xterm .xterm-screen canvas {
  position: absolute;
  left: 0;
  top: 0;
}
.xterm .xterm-scroll-area {
  visibility: hidden;
}
.xterm-char-measure-element {
  display: inline-block;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: -9999em;
  line-height: normal;
}
.xterm.enable-mouse-events {
  cursor: default;
}
.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
  cursor: pointer;
}
.xterm.column-select.focus {
  cursor: crosshair;
}
.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 10;
  color: transparent;
  pointer-events: none;
}
.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}
.xterm .xterm-accessibility-tree {
  user-select: text;
  white-space: pre;
}
.xterm .live-region {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.xterm-dim {
  opacity: 1 !important;
}
.xterm-underline-1 {
  text-decoration: underline;
}
.xterm-underline-2 {
  text-decoration: double underline;
}
.xterm-underline-3 {
  text-decoration: wavy underline;
}
.xterm-underline-4 {
  text-decoration: dotted underline;
}
.xterm-underline-5 {
  text-decoration: dashed underline;
}
.xterm-overline {
  text-decoration: overline;
}
.xterm-overline.xterm-underline-1 {
  text-decoration: overline underline;
}
.xterm-overline.xterm-underline-2 {
  text-decoration: overline double underline;
}
.xterm-overline.xterm-underline-3 {
  text-decoration: overline wavy underline;
}
.xterm-overline.xterm-underline-4 {
  text-decoration: overline dotted underline;
}
.xterm-overline.xterm-underline-5 {
  text-decoration: overline dashed underline;
}
.xterm-strikethrough {
  text-decoration: line-through;
}
.xterm-screen .xterm-decoration-container .xterm-decoration {
  z-index: 6;
  position: absolute;
}
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
  z-index: 7;
}
.xterm-decoration-overview-ruler {
  z-index: 8;
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}
.xterm-decoration-top {
  z-index: 2;
  position: relative;
}

/* web/style.css */
:root {
  --bg: #0b0d10;
  --bg-deep: #08090c;
  --panel: #12161c;
  --panel-2: #161b23;
  --panel-3: #1b212b;
  --border: #1f2630;
  --border-strong: #2a3340;
  --text: #e6edf5;
  --text-dim: #aab6c5;
  --muted: #8b97a7;
  --faint: #5d6977;
  --accent: #8affc1;
  --accent-2: #5ad7ff;
  --accent-ink: #04150d;
  --warn: #ffcf6b;
  --danger: #ff6b81;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --mono:
    ui-monospace,
    "SF Mono",
    "JetBrains Mono",
    "Cascadia Code",
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  --sans:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    system-ui,
    "Helvetica Neue",
    sans-serif;
  --nav-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--accent-2);
  text-decoration: none;
  touch-action: manipulation;
}
img,
svg,
canvas {
  -webkit-user-drag: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.views {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.view.is-active {
  display: flex;
}
.view-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.page {
  padding: 6px 14px calc(var(--safe-b) + 26px);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.stack > * + * {
  margin-top: 12px;
}
.head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: calc(var(--safe-t) + 8px) calc(12px + var(--safe-r)) 8px calc(14px + var(--safe-l));
  background:
    linear-gradient(
      180deg,
      var(--bg) 65%,
      rgba(11, 13, 16, 0.6));
}
.head h1 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head .sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head .spacer {
  flex: 1 1 auto;
  min-width: 4px;
}
.head .title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  box-shadow: 0 6px 18px -10px rgba(138, 255, 193, 0.55);
}
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  background: rgba(11, 13, 16, 0.94);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--border);
  z-index: 20;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}
.tab svg {
  width: 22px;
  height: 22px;
}
.tab.is-active {
  color: var(--accent);
}
.tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 34px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(
      90deg,
      var(--accent),
      var(--accent-2));
  box-shadow: 0 0 12px rgba(138, 255, 193, 0.6);
}
.tab:active {
  background: rgba(138, 255, 193, 0.05);
}
.card {
  background:
    linear-gradient(
      180deg,
      var(--panel-2),
      var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.card.tight {
  padding: 10px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.card-head svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex: none;
}
.card-head .spacer {
  flex: 1;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(
      120% 160% at 0% 0%,
      rgba(138, 255, 193, 0.13),
      transparent 55%),
    radial-gradient(
      120% 160% at 100% 120%,
      rgba(90, 215, 255, 0.1),
      transparent 55%),
    linear-gradient(
      180deg,
      var(--panel-2),
      var(--panel));
}
.hero .hero-text {
  min-width: 0;
  flex: 1;
}
.hero h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-gap {
  margin-top: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.faint {
  color: var(--faint);
}
.error-text {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 8px;
  line-height: 1.45;
}
.mono-box {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-dim);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex: none;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.pill.ok {
  color: var(--accent);
  border-color: rgba(138, 255, 193, 0.3);
  background: rgba(138, 255, 193, 0.08);
}
.pill.ok .dot {
  box-shadow: 0 0 8px rgba(138, 255, 193, 0.9);
  animation: pulse 2.4s ease-in-out infinite;
}
.pill.starting {
  color: var(--warn);
  border-color: rgba(255, 207, 107, 0.32);
  background: rgba(255, 207, 107, 0.08);
}
.pill.starting .dot {
  animation: pulse 1s ease-in-out infinite;
}
.pill.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.32);
  background: rgba(255, 107, 129, 0.08);
}
.pill.info {
  color: var(--accent-2);
  border-color: rgba(90, 215, 255, 0.3);
  background: rgba(90, 215, 255, 0.08);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--panel-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform 0.08s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.btn-primary {
  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 8px 24px -12px rgba(138, 255, 193, 0.7);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-dim);
}
.btn-soft {
  background: rgba(138, 255, 193, 0.1);
  border-color: rgba(138, 255, 193, 0.24);
  color: var(--accent);
}
.btn-danger {
  background: rgba(255, 107, 129, 0.12);
  border-color: rgba(255, 107, 129, 0.34);
  color: var(--danger);
}
.btn-sm {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn-block {
  width: 100%;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: none;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.icon-btn:active {
  background: var(--panel-3);
}
.icon-btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}
.icon-btn.sm {
  width: 38px;
  height: 38px;
  min-height: 38px;
}
.icon-btn.sm svg {
  width: 18px;
  height: 18px;
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  text-transform: capitalize;
  white-space: nowrap;
  padding: 0 3px;
}
.seg button svg {
  width: 14px;
  height: 14px;
}
.seg button:disabled {
  opacity: 0.32;
  pointer-events: none;
}
.seg button.is-active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
  white-space: nowrap;
}
.kv dd {
  margin: 0;
  text-align: right;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}
.stat {
  margin-top: 12px;
}
.stat:first-child {
  margin-top: 0;
}
.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.stat-line .label {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stat-line .value {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.meter {
  height: 6px;
  border-radius: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background:
    linear-gradient(
      90deg,
      var(--accent),
      var(--accent-2));
  transition: width 0.5s ease;
}
.meter.warn > i {
  background:
    linear-gradient(
      90deg,
      var(--warn),
      #ff9f6b);
}
.meter.danger > i {
  background:
    linear-gradient(
      90deg,
      var(--danger),
      #ff9f6b);
}
.gauges {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.gauge {
  padding: 7px 9px 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
}
.gauge-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
.gauge-top b {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dim);
}
.gauge .meter {
  height: 4px;
}
.tunnel-setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 207, 107, 0.28);
  background: rgba(255, 207, 107, 0.07);
}
.tunnel-setup-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--warn);
}
.tunnel-setup-head svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.tunnel-setup-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tunnel-setup-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.tunnel-setup-actions .btn {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 8px;
  font-size: 12.5px;
}
.url-box {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 12px;
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
}
.url-box .url {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.url-box .url.empty {
  color: var(--faint);
  font-family: var(--sans);
}
.url-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}
.qr-area .tunnel-setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 207, 107, 0.28);
  background: rgba(255, 207, 107, 0.07);
}
.tunnel-setup-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--warn);
}
.tunnel-setup-head svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.tunnel-setup-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tunnel-setup-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.tunnel-setup-actions .btn {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 8px;
  font-size: 12.5px;
}
.url-box {
  width: 100%;
}
.qr-frame {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  line-height: 0;
  border: 1px solid var(--border-strong);
}
.qr-frame img {
  width: min(216px, 62vw);
  height: auto;
  display: block;
}
.qr-caption {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.pair-countdown {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
}
.list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
}
.row:active {
  background: var(--panel-3);
}
.row .row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.row .row-title {
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .row-sub {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .chev {
  flex: none;
  color: var(--faint);
  width: 18px;
  height: 18px;
}
.row-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--accent-2);
}
.row-icon svg {
  width: 18px;
  height: 18px;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.empty svg {
  width: 26px;
  height: 26px;
  opacity: 0.5;
}
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 0 4px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}
.footer .build {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--safe-t) + 26px) 20px calc(var(--safe-b) + 26px);
  overflow-y: auto;
  background:
    radial-gradient(
      900px 480px at 50% -12%,
      rgba(138, 255, 193, 0.12),
      transparent 62%),
    radial-gradient(
      760px 460px at 106% 112%,
      rgba(90, 215, 255, 0.11),
      transparent 60%),
    var(--bg);
}
.gate-card {
  width: min(400px, 100%);
  padding: 26px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(
      180deg,
      var(--panel-2),
      var(--panel));
  box-shadow: 0 34px 90px -34px #000;
}
.gate-logo {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  margin: 0 auto 16px;
  box-shadow: 0 12px 34px -16px rgba(138, 255, 193, 0.6);
}
.gate h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
}
.gate .sub {
  margin-top: 6px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.input,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea {
  padding: 12px 14px;
  min-height: 110px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}
.input:focus,
.textarea:focus {
  border-color: rgba(138, 255, 193, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 255, 193, 0.12);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}
.gate .btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}
.gate-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 107, 129, 0.32);
  background: rgba(255, 107, 129, 0.1);
  color: #ffb7c0;
  font-size: 13px;
  line-height: 1.45;
}
.gate-ok {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(138, 255, 193, 0.3);
  background: rgba(138, 255, 193, 0.08);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.45;
}
.gate-note {
  margin-top: 16px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
}
.steps {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
}
.steps code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(138, 255, 193, 0.08);
  border: 1px solid rgba(138, 255, 193, 0.16);
  border-radius: 6px;
  padding: 1px 5px;
}
.gate-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.gate-brand svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.term-head {
  gap: 8px;
}
.session-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}
.session-btn .name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-btn svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: none;
}
.term-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.term-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.term-status.connected {
  color: var(--accent);
}
.term-status.connecting {
  color: var(--warn);
}
.term-status.offline {
  color: var(--danger);
}
.term-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.term-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  padding: 8px 4px 0 10px;
}
.term-wrap .xterm {
  height: 100%;
}
.xterm .xterm-viewport {
  background: transparent !important;
  scrollbar-width: none;
}
.xterm .xterm-viewport::-webkit-scrollbar {
  display: none;
}
.xterm-screen {
  touch-action: none;
}
.term-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px calc(8px + var(--safe-b));
  border-top: 1px solid var(--border);
  background: rgba(11, 13, 16, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.key {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.key svg {
  width: 15px;
  height: 15px;
}
.key:active {
  background: var(--panel-3);
  color: var(--text);
}
.key.is-on {
  border-color: rgba(138, 255, 193, 0.5);
  background: rgba(138, 255, 193, 0.12);
  color: var(--accent);
}
.term-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(22, 27, 35, 0.97);
  box-shadow: 0 14px 36px -16px #000;
  font-size: 12px;
  color: var(--text-dim);
}
.term-banner .spacer {
  flex: 1;
}
.term-banner .btn-sm {
  min-height: 34px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.crumbs::-webkit-scrollbar {
  display: none;
}
.crumb {
  flex: none;
  padding: 9px 5px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.crumb.is-current {
  color: var(--text);
}
.crumb-sep {
  flex: none;
  color: var(--faint);
  font-size: 11px;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px calc(var(--safe-b) + 24px);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  width: 100%;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
}
.file-row:active {
  background: var(--panel-3);
}
.file-row .fi {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}
.file-row .fi svg {
  width: 18px;
  height: 18px;
}
.file-row.is-dir .fi {
  color: var(--accent-2);
}
.file-row.is-hidden .name-label {
  color: var(--faint);
}
.file-row .name-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row .meta {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
  flex: none;
}
.file-row .more {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
}
.file-row .more svg {
  width: 18px;
  height: 18px;
}
.file-row .more:active {
  background: var(--panel);
}
.editor-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.editor-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.editor-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-name .dirty {
  color: var(--warn);
}
.editor-host {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.editor-host .cm-editor {
  height: 100%;
  background: transparent;
}
.editor-host .cm-scroller {
  font-family: var(--mono);
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}
.editor-host .cm-gutters {
  background: transparent;
  border-right: 1px solid var(--border);
  color: var(--faint);
}
.editor-host .cm-activeLineGutter,
.editor-host .cm-activeLine {
  background: rgba(138, 255, 193, 0.05);
}
.editor-host .cm-selectionBackground,
.editor-host .cm-content ::selection {
  background: rgba(90, 215, 255, 0.25) !important;
}
.editor-host .cm-cursor {
  border-left-color: var(--accent);
}
.editor-fallback {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  padding: 12px;
  tab-size: 2;
  user-select: text;
  -webkit-user-select: text;
}
.editor-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--warn);
  background: rgba(255, 207, 107, 0.08);
  border-bottom: 1px solid rgba(255, 207, 107, 0.2);
}
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 12px;
  color: var(--muted);
  font-size: 13px;
}
.browser-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: calc(var(--safe-t) + 6px) calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}
.browser-bar .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 44px;
}
.url-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 14px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.url-input:focus {
  border-color: rgba(138, 255, 193, 0.5);
  box-shadow: 0 0 0 3px rgba(138, 255, 193, 0.1);
}
.browser-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--muted);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  flex: none;
}
.meta-chip svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex: none;
}
.meta-chip:active {
  background: var(--panel-3);
}
.meta-chip[disabled] {
  opacity: 0.4;
  pointer-events: none;
}
.meta-chip.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
.browser-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browser-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.browser-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #fff;
  touch-action: none;
}
.browser-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 28px 24px;
  text-align: center;
  color: var(--text-dim);
  background-color: #07090c;
  background-image:
    linear-gradient(rgba(31, 38, 48, 0.42) 1px, transparent 1px),
    linear-gradient(
      90deg,
      rgba(31, 38, 48, 0.42) 1px,
      transparent 1px),
    radial-gradient(
      120% 80% at 50% 0%,
      rgba(90, 215, 255, 0.09),
      transparent 62%),
    radial-gradient(
      100% 70% at 50% 105%,
      rgba(138, 255, 193, 0.06),
      transparent 60%);
  background-size:
    26px 26px,
    26px 26px,
    100% 100%,
    100% 100%;
  background-position: center;
  box-shadow: inset 0 0 150px 30px rgba(0, 0, 0, 0.7);
}
.browser-empty.hidden {
  display: none;
}
.browser-empty-art {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(
      180deg,
      var(--panel-2),
      var(--panel));
  color: var(--accent);
  box-shadow: 0 20px 54px -22px rgba(138, 255, 193, 0.45);
}
.browser-empty-art svg {
  width: 30px;
  height: 30px;
}
.browser-empty h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.browser-empty p {
  max-width: 32ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.browser-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.browser-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(22, 27, 35, 0.82);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}
.browser-chip svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--accent-2);
}
.browser-chip:active {
  background: var(--panel-3);
}
.browser-empty-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--faint);
}
.browser-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  background:
    radial-gradient(
      60% 50% at 50% 40%,
      rgba(18, 22, 28, 0.65),
      rgba(0, 0, 0, 0.82));
  pointer-events: none;
}
.browser-overlay .btn,
.browser-overlay .kb {
  pointer-events: auto;
}
.kb-capture {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 2px;
  height: 2px;
  padding: 0;
  border: 0;
  outline: none;
  opacity: 0.02;
  background: transparent;
  color: transparent;
  font-size: 16px;
  resize: none;
  overflow: hidden;
  z-index: 3;
}
.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(440px, 100%);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(22, 27, 35, 0.97);
  box-shadow: 0 16px 44px -14px rgba(0, 0, 0, 0.85);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  animation: toast-in 0.18s ease;
}
.toast svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--accent-2);
}
.toast.ok {
  border-color: rgba(138, 255, 193, 0.34);
}
.toast.ok svg {
  color: var(--accent);
}
.toast.err {
  border-color: rgba(255, 107, 129, 0.38);
}
.toast.err svg {
  color: var(--danger);
}
.toast.leaving {
  animation: toast-out 0.16s ease forwards;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade-in 0.15s ease;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  max-height: 82vh;
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 12px calc(var(--safe-b) + 12px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: 0 -26px 70px -24px #000;
  animation: sheet-up 0.22s cubic-bezier(0.22, 0.85, 0.3, 1);
}
.sheet-title {
  padding: 10px 12px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
  text-align: left;
}
.sheet-item svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--muted);
}
.sheet-item:active {
  background: var(--panel-3);
}
.sheet-item.danger {
  color: var(--danger);
}
.sheet-item.danger svg {
  color: var(--danger);
}
.sheet-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.sheet-body {
  padding: 0 6px;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.sheet-actions .btn {
  flex: 1 1 0;
}
.sheet .input,
.sheet .textarea {
  margin: 2px 0 10px;
  font-size: 16px;
}
.sheet-note {
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(138, 255, 193, 0.16);
  background: rgba(138, 255, 193, 0.06);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.unlock-fp {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.unlock-sub {
  margin: 0 0 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.link-btn.subtle {
  min-height: 36px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.link-btn:active {
  opacity: 0.7;
}
.unlock-hint {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(90, 215, 255, 0.22);
  background: rgba(90, 215, 255, 0.06);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.unlock-switch {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}
.sheet-section-label {
  padding: 12px 6px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.spinner {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(138, 255, 193, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
}
.spinner.lg {
  width: 26px;
  height: 26px;
  border-width: 3px;
}
.spin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px;
  color: var(--muted);
  font-size: 13px;
}
.offline-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px calc(7px + var(--safe-b));
  background: rgba(255, 107, 129, 0.12);
  border-top: 1px solid rgba(255, 107, 129, 0.28);
  color: #ffb7c0;
  font-size: 12px;
}
.offline-bar svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.shake {
  animation: shake 0.4s ease;
}
.controls {
  display: flex;
  flex-direction: column;
}
.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}
.ctrl-row:first-child {
  border-top: 0;
}
.ctrl-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ctrl-label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.ctrl-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dim);
}
.ctrl-value.muted {
  color: var(--warn);
}
.ctrl-now {
  max-width: 205px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-dim);
}
.ctrl-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
}
.ctrl-btn svg {
  width: 18px;
  height: 18px;
}
.ctrl-btn:active {
  background: var(--panel-3);
  color: var(--text);
}
.ctrl-btn[disabled] {
  opacity: 0.45;
}
.ctrl-btn.is-on {
  border-color: rgba(255, 207, 107, 0.45);
  background: rgba(255, 207, 107, 0.12);
  color: var(--warn);
}
.ctrl-glyph {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}
.ctrl-system {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.ctrl-system-btn {
  flex: 1 1 0;
  min-height: 44px;
  gap: 7px;
}
.ctrl-system-btn svg {
  width: 16px;
  height: 16px;
}
.ctrl-open {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ctrl-open-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.ctrl-url-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  font-size: 14px;
  padding: 0 12px;
}
.ctrl-send {
  min-height: 44px;
  padding: 0 14px;
  gap: 6px;
}
.controls-note {
  margin-top: 10px;
  line-height: 1.5;
}
.ctrl-power-wrap {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ctrl-power-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ctrl-value.unknown {
  color: var(--faint);
  font-style: italic;
  font-size: 12px;
}
.ctrl-power {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ctrl-power-lockcell {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.ctrl-power-lockcell .ctrl-power-btn {
  flex: 1 1 auto;
  min-width: 0;
}
.ctrl-fp-btn {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(138, 255, 193, 0.4);
  background: rgba(138, 255, 193, 0.12);
  color: var(--accent);
}
.ctrl-fp-btn svg {
  width: 20px;
  height: 20px;
}
.ctrl-fp-btn:active {
  background: rgba(138, 255, 193, 0.2);
}
.ctrl-power-btn {
  min-height: 46px;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.ctrl-power-btn svg {
  width: 17px;
  height: 17px;
}
.ctrl-power-btn.is-unknown {
  border-style: dashed;
}
.wol-line {
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
}
.screen-head {
  flex: 0 0 auto;
  padding: calc(var(--safe-t) + 6px) calc(6px + var(--safe-r)) 6px calc(6px + var(--safe-l));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.screen-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}
.screen-name {
  margin-right: 2px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.screen-bar .pill {
  height: 24px;
  padding: 0 8px;
  font-size: 10px;
}
.screen-bar .icon-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
}
.screen-mode-btn {
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
}
.screen-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #0b0d10;
}
.screen-zoom {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #0b0d10;
}
.screen-zoom.is-zoomed {
  touch-action: pan-x pan-y;
}
.screen-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0d10;
  transform-origin: top left;
  will-change: transform;
}
.screen-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 24px;
  text-align: center;
  background:
    radial-gradient(
      120% 80% at 50% 0%,
      rgba(90, 215, 255, 0.07),
      transparent 62%),
    radial-gradient(
      100% 70% at 50% 110%,
      rgba(138, 255, 193, 0.06),
      transparent 60%),
    #080a0d;
}
.screen-art {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(
      180deg,
      var(--panel-2),
      var(--panel));
  color: var(--accent);
  box-shadow: 0 20px 54px -22px rgba(138, 255, 193, 0.4);
}
.screen-art svg {
  width: 30px;
  height: 30px;
}
.screen-message h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.screen-message p {
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.screen-message .mono-box {
  max-width: min(340px, 100%);
  text-align: left;
  font-size: 11px;
}
.screen-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.screen-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 10, 13, 0.88);
  color: var(--text-dim);
  font-size: 12.5px;
  pointer-events: none;
}
.screen-tip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  z-index: 6;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: rgba(22, 27, 35, 0.98);
  box-shadow: 0 24px 60px -22px #000;
}
.screen-tip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.screen-tip-head svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.screen-tip-head h3 {
  font-size: 14px;
  font-weight: 700;
}
.screen-tip p {
  margin: 0 0 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
.screen-tip .btn {
  width: 100%;
  margin-top: 8px;
}
.screen-touchbar {
  position: absolute;
  right: 10px;
  bottom: calc(10px + var(--safe-b));
  z-index: 5;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(11, 13, 16, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -14px #000;
}
.screen-touchbar .key {
  width: 44px;
  height: 44px;
  background: rgba(22, 27, 35, 0.85);
}
.screen-locked {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  text-align: center;
  background: rgba(8, 10, 13, 0.86);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.screen-locked-art {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 17px;
  border: 1px solid rgba(255, 207, 107, 0.35);
  background: rgba(255, 207, 107, 0.1);
  color: var(--warn);
}
.screen-locked-art svg {
  width: 28px;
  height: 28px;
}
.screen-locked .screen-actions {
  gap: 8px;
}
.screen-locked .screen-actions .btn {
  min-height: 46px;
  padding: 0 15px;
}
.screen-locked h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.screen-locked p {
  max-width: 32ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.view:fullscreen {
  background: #000;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(14px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes toast-out {
  to {
    transform: translateY(6px);
    opacity: 0;
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 380px) {
  .screen-name {
    display: none;
  }
  .seg button {
    font-size: 10.5px;
  }
  .browser-meta {
    gap: 6px;
  }
  .meta-chip {
    padding: 0 7px;
    font-size: 10.5px;
  }
  .tab {
    font-size: 9px;
    letter-spacing: 0.01em;
  }
  .tab svg {
    width: 20px;
    height: 20px;
  }
  .ctrl-now {
    max-width: 150px;
  }
}
@media (max-height: 520px) {
  .tab {
    min-height: 40px;
  }
  .tabbar {
    --nav-h: 50px;
  }
  .head {
    min-height: 44px;
    padding-top: calc(var(--safe-t) + 4px);
    padding-bottom: 4px;
  }
}
