.app { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }

.view {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-6) var(--s-10);
}
.view--wide { padding: 0; max-width: none; }

body.is-plain .topbar { display: none; }
body.is-plain .view { padding: 0; max-width: none; }

.topbar { padding-left: 16px; padding-right: 16px; }
.tb-brand { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.tb-brand__name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.tb-brand__sub { font-family: var(--font-mono); font-size: 10px; color: var(--fg-4); letter-spacing: .02em; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-build {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 9px;
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--primary-fg); font-size: 12px;
  transition: background var(--fast), border-color var(--fast);
}
.tb-build:hover { background: var(--primary-hover); border-color: var(--accent); }
.tb-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); }
.tb-sep { width: 1px; height: 18px; background: var(--line); }
.tb-user { display: inline-flex; border-radius: var(--r-full); }

.dv-updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-3); }
.dv-updated .dot { color: var(--ok); }

.dv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--s-4);
}

.dv-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-inset);
  cursor: default;
  pointer-events: none;
}

.dv-card.is-off .dv-card__head,
.dv-card.is-off .dv-card__meta,
.dv-card.is-off .dv-card__rtt { opacity: .42; }
.dv-card.is-off .dv-choose { opacity: .55; }
.dv-choose { pointer-events: auto; }

.dv-card__head { display: flex; align-items: flex-start; gap: 10px; }
.dv-card__head .status { margin-top: 4px; }
.dv-card__id { flex: 1; min-width: 0; }
.dv-card__host {
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dv-card__sub { margin-top: 2px; font-size: 11.5px; color: var(--fg-3); }

.dv-card__state { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.dv-card__seen { font-size: 10.5px; color: var(--fg-4); }

.dv-card__meta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px 12px;
  margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.dv-card__meta div { min-width: 0; }
.dv-card__meta dt {
  font-size: 9.5px; line-height: 12px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fg-4); font-weight: 600;
}
.dv-card__meta dd {
  margin: 5px 0 0; font-size: 12px; line-height: 18px; color: var(--fg-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center;
}

.dv-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  min-height: 38px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.dv-card__rtt { font-size: 11.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.dv-choose { display: flex; align-items: center; gap: 6px; }
.dv-choose .btn { min-width: 52px; justify-content: center; }

@media (max-width: 1200px) { .dv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .dv-grid { grid-template-columns: 1fr; } .tb-brand__sub { display: none; } }

.sv {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar));
  min-height: 560px;
  background: var(--bg);
}

.sv-head {
  flex: none;
  height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.sv-id { min-width: 0; margin-right: 4px; }
.sv-host { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 18px; }
.sv-os { font-size: 11px; color: var(--fg-3); line-height: 14px; }
.sv-live { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--fg-3); }
.sv-live__sep { width: 1px; height: 12px; background: var(--line); }

.sv-tools {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}
.sv-tools .btn,
.sv-tools .select,
.sv-tools .input { height: 28px; }
.sv-group { display: flex; align-items: center; gap: 6px; }
.sv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.sv-select { width: 118px; height: 28px; font-size: 12px; }
.sv-url { width: 220px; height: 28px; font-size: 12px; }

.sv-toggle.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.sv-popwrap { position: relative; }
.sv-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 280px; padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  display: none;
  z-index: 40;
}
.sv-popwrap.is-open .sv-pop { display: block; }
.sv-pop__body { display: grid; gap: 8px; }
.sv-pop__row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.sv-pop__label { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); font-weight: 600; }
.sv-pop__hint { font-size: 11px; color: var(--fg-3); line-height: 1.45; }

.sv-stage {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  display: grid; place-items: center;
  padding: 16px;
  background: #070510;
}
.sv-screen {
  position: relative;
  width: min(100%, calc((100vh - 220px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .65);
  background: #0b0e13;
}
.sv-screen.is-viewonly { cursor: default; }
.sv-viewonly {
  position: absolute; right: 28px; bottom: 28px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #cbd2dc; font-size: 11px;
  backdrop-filter: blur(8px);
}
.sv-blank {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: #0A0710;
  z-index: 10;
  text-align: center;
  padding: 24px;
}
.sv-blank.is-on { display: flex; }
.sv-blank__badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #cbd2dc; font-size: 11px;
}
.sv-blank__title { margin-top: 6px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: #e8ecf2; }
.sv-blank__text { font-size: 12.5px; color: #8b93a1; }
.sv-blank__bar { width: 240px; height: 5px; border-radius: var(--r-full); background: #1a2028; overflow: hidden; margin-top: 6px; }
.sv-blank__bar i { display: block; height: 100%; background: #e8ecf2; }
.sv-blank__hint { font-size: 11px; color: #6b7280; margin-top: 2px; }
.sv-blank .btn { margin-top: 8px; }

.ds {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(66, 42, 104, .55), transparent 60%),
    linear-gradient(160deg, #120C1E 0%, #0A0712 60%, #07050C 100%);
  overflow: hidden;
}
.ds::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.ds-win {
  position: absolute; left: 7%; right: 7%; top: 8%; bottom: 14%;
  display: flex; flex-direction: column;
  border-radius: 10px; overflow: hidden;
  background: #0e1116;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.ds-win__bar {
  height: 34px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px;
  background: #151a21;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.ds-tabs { display: flex; gap: 4px; flex: 1; min-width: 0; }
.ds-tab {
  display: flex; align-items: center; gap: 6px;
  height: 25px; padding: 0 9px;
  border-radius: 6px 6px 0 0;
  background: #1a2028; color: #7c8593;
  font-size: 10.5px; white-space: nowrap; overflow: hidden;
  max-width: 180px;
}
.ds-tab.is-on { background: #0e1116; color: #cfd6e2; }
.ds-fav { width: 8px; height: 8px; border-radius: 2px; background: #566070; flex: none; }
.ds-tabx { margin-left: auto; opacity: .55; font-size: 11px; }
.ds-ctl { display: flex; gap: 12px; color: #6b7280; font-size: 11px; padding-right: 4px; }
.ds-nav {
  height: 32px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 0 9px;
  background: #0e1116;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  color: #6b7280; font-size: 11px;
}
.ds-nav__ico { width: 16px; text-align: center; }
.ds-url {
  flex: 1; height: 21px;
  display: flex; align-items: center;
  padding: 0 10px;
  border-radius: 10px;
  background: #171c23;
  color: #9aa3b0; font-size: 10px;
  overflow: hidden; white-space: nowrap;
}
.ds-page {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px; padding: 22px 24px;
  background: #0b0e13;
}
.ds-card {
  align-self: start;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #11151b;
  border: 1px solid rgba(255, 255, 255, .06);
}
.ds-sk { background: #1b2129; border-radius: 4px; }
.ds-sk--logo { width: 32px; height: 32px; border-radius: 8px; margin-bottom: 2px; }
.ds-sk--line { height: 9px; width: 72%; }
.ds-sk--input { height: 26px; width: 100%; background: #0d1117; border: 1px solid #232a33; border-radius: 5px; }
.ds-sk--check { height: 9px; width: 54%; }
.ds-sk--btn { height: 26px; width: 100%; background: #e6e9ee; border-radius: 5px; margin-top: 4px; }
.ds-sk--short { height: 8px; width: 42%; }
.ds-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ds-block {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #11151b;
  border: 1px solid rgba(255, 255, 255, .06);
}
.ds-block--tall { flex: 1; }
.ds-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.ds-row { height: 8px; border-radius: 3px; background: #1a2027; }
.ds-row:nth-child(odd) { width: 92%; }
.ds-row:nth-child(even) { width: 78%; }
.ds-block--tall .ds-row { height: 10px; }
.ds-task {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 34px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: rgba(10, 13, 18, .94);
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.ds-task__start { width: 14px; height: 14px; border-radius: 3px; background: #2a3140; }
.ds-task__ico { width: 15px; height: 15px; border-radius: 3px; background: #1c222b; }
.ds-task__clock { margin-left: auto; font-size: 10px; color: #8b93a1; }

@media (max-width: 1360px) {
  .sv-url { width: 150px; }
  .sv-browser__btn { min-width: 112px; }
}
@media (max-width: 1180px) {
  .sv-screen { width: min(100%, calc((100vh - 300px) * 16 / 9)); }
  .sv-url { width: 130px; }
}
@media (max-width: 820px) {
  .sv-head { height: auto; flex-wrap: wrap; padding: 8px 12px; }
  .sv-live { display: none; }
  .ds-page { grid-template-columns: 1fr; }
  .ds-side { display: none; }
}

.sheet-scrim {
  position: fixed; inset: 0; z-index: 70;
  display: flex; justify-content: flex-end;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
}
.sheet {
  width: min(480px, 100%); height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line-strong);
  animation: sheet-in 180ms var(--ease);
}
@keyframes sheet-in { from { opacity: .5; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.sheet__head > .btn { margin-left: auto; }
.sheet__title { font-size: 14px; font-weight: 600; }
.sheet__sub { margin-top: 2px; font-size: 12px; color: var(--fg-3); }
.sheet__body { flex: 1; overflow-y: auto; padding: 16px; }
.sheet__foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }

.sv-files-head, .sv-file {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 74px 64px 28px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.sv-files-head {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--fg-4); font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.sv-file__ico { display: flex; color: var(--fg-3); }
.sv-file__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-file__size, .sv-file__date { color: var(--fg-3); font-size: 11px; }

.lg-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(209, 74, 82, .08), transparent 70%),
    var(--bg);
}
.lg-card {
  width: min(380px, 100%);
  display: flex; flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-3);
}
.lg-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--bg-control);
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.lg-title { margin-top: 16px; font-size: 24px; line-height: 30px; letter-spacing: -.02em; }
.lg-sub { margin-top: 4px; font-size: 12.5px; line-height: 20px; color: var(--fg-3); }
.lg-foot { margin-top: 18px; text-align: center; font-size: 10.5px; color: var(--fg-4); }

.brand-mark {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--bg-control);
  border: 1px solid var(--line-strong);
  color: var(--accent);
}
.tb-brand__name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }

.lg-pass { position: relative; }
.lg-pass__input { padding-right: 38px; }
.lg-pass__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--fg-3);
  transition: background var(--fast), color var(--fast);
}
.lg-pass__eye:hover { background: var(--bg-control); color: var(--fg); }
.lg-pass__eye.is-on { color: var(--accent); }
.lg-pass__eye svg { animation: icon-pop 180ms var(--ease); }

@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes login-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes screen-in { from { opacity: 0; transform: scale(.995); } to { opacity: 1; transform: none; } }
@keyframes blank-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes icon-pop { from { opacity: .3; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.view { animation: view-in 200ms var(--ease) both; }
.lg-card { animation: login-in 320ms var(--ease) both; }
.sv-screen { animation: screen-in 260ms var(--ease) both; }
.sv-blank.is-on { animation: blank-in 200ms var(--ease) both; }
.sheet-scrim { animation: scrim-in 160ms var(--ease) both; }
.sheet { animation: sheet-in 220ms var(--ease) both; }

.dv-card { animation: card-in 280ms var(--ease) both; }
.dv-card:nth-child(1) { animation-delay: 0ms; }
.dv-card:nth-child(2) { animation-delay: 30ms; }
.dv-card:nth-child(3) { animation-delay: 60ms; }
.dv-card:nth-child(4) { animation-delay: 90ms; }
.dv-card:nth-child(5) { animation-delay: 120ms; }
.dv-card:nth-child(6) { animation-delay: 150ms; }
.dv-card:nth-child(7) { animation-delay: 180ms; }
.dv-card:nth-child(8) { animation-delay: 210ms; }

.btn svg { transition: transform var(--fast) var(--ease); }
.btn.is-spinning svg { animation: spin .55s linear; }
.sv-toggle.is-on svg { animation: icon-pop 220ms var(--ease); }
.sv-pop { transform-origin: top right; }
.sv-popwrap.is-open .sv-pop { animation: icon-pop 160ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .view, .dv-card, .lg-card, .sv-screen, .sheet, .sheet-scrim, .sv-pop { animation: none !important; }
  
}

.sv-browser { position: relative; }
.sv-browser__btn {
  height: 28px; min-width: 128px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 8px 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg); font-size: 12px;
  transition: border-color var(--fast), background var(--fast);
}
.sv-browser__btn:hover { border-color: var(--line-strong); background: var(--bg-subtle); }
.sv-browser__chev { margin-left: auto; display: flex; color: var(--fg-4); }
.sv-browser__menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: 176px; padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  display: none; z-index: 50;
}
.sv-browser.is-open .sv-browser__menu { display: block; animation: icon-pop 140ms var(--ease); }
.sv-browser__item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 30px; padding: 0 8px;
  border-radius: 5px;
  font-size: 12px; color: var(--fg-2);
}
.sv-browser__item:hover { background: var(--bg-control); color: var(--fg); }
.sv-browser__item.is-on { background: var(--bg-control); color: var(--fg); }

.sv-pop--text { width: 340px; }
.sv-pop__body--text { gap: 8px; }
.sv-textarea { min-height: 92px; max-height: 170px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.sv-pop__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }

body.is-popout .topbar { display: none; }
body.is-popout .view { padding: 0; max-width: none; height: 100vh; }
.sv--popout { height: 100vh; min-height: 0; }
.sv--popout .sv-stage { height: 100vh; padding: 0; }
.sv--popout .sv-screen {
  width: min(100vw, calc(100vh * 16 / 9));
  border: 0; border-radius: 0; box-shadow: none;
}
.sv-popclose {
  position: fixed; top: 10px; right: 10px; z-index: 60;
  background: rgba(0, 0, 0, .55);
  color: #e9edf3;
  border-color: rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
}
.sv-popclose:hover { background: rgba(0, 0, 0, .72); border-color: rgba(255, 255, 255, .3); }

