:root {
  --ink: #1f2529;
  --rail: #2f3438;
  --rail-2: #252a2e;
  --panel: #f5f2ec;
  --surface: #ffffff;
  --line: #d8d3ca;
  --muted: #687178;
  --accent: #167c80;
  --accent-2: #0f6065;
  --danger: #b43d3d;
  --shadow: 0 14px 35px rgba(31, 37, 41, 0.14);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--panel);
  min-height: 100vh;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell,
.desktop-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 68px 318px minmax(0, 1fr);
}

.desktop-frame {
  grid-template-columns: 254px minmax(0, 1fr);
  min-height: 100vh;
  background: #f7f8fa;
}

.rail {
  background: #eef1f5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 10px 14px;
  gap: 4px;
  border-right: 1px solid #d9dee5;
}

.brand-mark {
  width: 100%;
  height: 86px;
  border: 0;
  display: grid;
  place-items: end start;
  color: #0872ce;
  font-weight: 800;
  background: transparent;
  font-size: 30px;
  padding: 0 6px 14px;
}

.rail-button {
  width: 100%;
  height: 42px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 5px;
  color: #172330;
  padding: 0 12px;
  text-align: left;
}

.rail-button.active,
.rail-button:hover {
  background: #ffffff;
  color: #0866c2;
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  position: relative;
  color: currentColor;
  flex: 0 0 auto;
}

.hamburger-button {
  height: 40px;
  width: 40px;
  border: 0;
  background: transparent;
  display: grid;
  gap: 4px;
  align-content: center;
  margin: 8px 0 0 2px;
  padding: 8px;
}

.hamburger-button span {
  display: block;
  height: 2px;
  background: #2b3844;
}

.connection-icon::before {
  content: "";
  position: absolute;
  inset: 3px 2px 8px;
  border: 2px solid currentColor;
}

.connection-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  width: 5px;
  height: 11px;
  border: 2px solid currentColor;
  border-top: 0;
  box-shadow: 0 8px 0 -2px currentColor;
}

.home-groups-icon::before,
.groups-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-top: 0;
  transform: skewY(-8deg);
}

.home-groups-icon::after,
.groups-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 9px 0 0 currentColor, 18px 0 0 currentColor;
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 3px;
  width: 4px;
  height: 14px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  width: 16px;
  height: 16px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.settings-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 3px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 -9px 0 -3px currentColor, 0 9px 0 -3px currentColor, 9px 0 0 -3px currentColor, -9px 0 0 -3px currentColor;
}

.tree-panel {
  border-right: 1px solid var(--line);
  background: #eee9df;
  padding: 20px;
  overflow: auto;
}

.tree-header,
.client-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  margin-bottom: 0;
}

h2 {
  font-size: 28px;
  line-height: 1.18;
}

.status-pill {
  min-width: 76px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 6px 9px;
  font-size: 12px;
  color: var(--muted);
}

.auth-card,
.panel,
.remote-tab,
.file-transfer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 14px;
}

.tabs,
.topbar-tabs {
  display: flex;
  gap: 8px;
}

.compact-tabs {
  margin-bottom: 12px;
}

.tab,
.topbar-tab,
.ghost-button,
.tool-button,
.primary-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
}

.tab.active,
.topbar-tab.active {
  color: #fff;
  background: var(--rail);
  border-color: var(--rail);
}

.primary-button {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button:hover {
  background: var(--accent-2);
}

.ghost-button:hover,
.tool-button:hover {
  border-color: var(--accent);
}

.danger-button {
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
}

form,
.form-grid {
  display: grid;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.tree-tools,
.home-toolbar,
.client-actions,
.quality-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tree-tools,
.home-toolbar {
  margin-bottom: 14px;
}

.search {
  min-width: 0;
}

.main-stage,
.client-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar,
.client-titlebar {
  min-height: 74px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.workspace,
.client-view {
  padding: 22px;
}

.empty-state {
  max-width: 720px;
}

.empty-state p {
  color: var(--muted);
}

.device-tree {
  display: grid;
  gap: 10px;
}

.tree-group {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  overflow: hidden;
}

.tree-group h3 {
  margin: 0;
  padding: 11px 12px;
  font-size: 14px;
  background: rgba(47, 52, 56, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tree-group h3 span {
  color: var(--muted);
  font-weight: 600;
}

.tree-device {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 2px;
}

.tree-device:hover {
  background: #fff;
}

.tree-device.selected {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.tree-device strong {
  font-size: 14px;
}

.tree-device span {
  font-size: 12px;
  color: var(--muted);
}

.client-titlebar {
  margin: 0;
  min-height: 82px;
  background: #0866c2;
  border-bottom: 0;
  color: #fff;
  align-items: center;
}

.client-account {
  display: grid;
  grid-template-columns: 220px auto 180px 150px auto;
  gap: 8px;
  align-items: center;
}

.client-titlebar input {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.client-titlebar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.client-titlebar .ghost-button,
.quick-connect button {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.quick-connect {
  width: min(440px, 45vw);
  min-width: 320px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 104px;
  align-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}

.quick-connect input {
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: Consolas, "Segoe UI Mono", monospace;
}

.quick-connect button {
  min-height: 36px;
  border-width: 0 0 0 1px;
  border-radius: 0;
}

.mini-connection-icon {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.title-status {
  margin: 4px 0 0;
  font-size: 12px;
}

.connection-grid {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(310px, 360px);
  gap: 46px;
  align-items: stretch;
}

.panel {
  padding: 18px;
}

.control-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.control-panel h1 {
  font-size: 24px;
  font-weight: 400;
  color: #172330;
  margin: 0 0 12px;
}

.pcid-display,
.password-display {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  background: #eef0f3;
  padding: 12px 20px;
}

.pcid-display {
  padding-top: 16px;
}

.password-display {
  padding-bottom: 16px;
}

.pcid-display span,
.password-display span,
.field-label,
.quality-row label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.pcid-display strong,
.password-display strong {
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-weight: 500;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  font-weight: 600;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.big-input {
  font-size: 22px;
  height: 54px;
  font-family: Consolas, "Segoe UI Mono", monospace;
  margin: 8px 0 12px;
  border-color: #0866c2;
  border-radius: 5px;
}

.control-panel .primary-button {
  width: 162px;
  height: 48px;
  background: #0b8cef;
  border-color: #0b8cef;
  border-radius: 4px;
  font-size: 18px;
}

.client-actions {
  flex-wrap: wrap;
}

.client-actions .primary-button {
  width: auto;
  height: 38px;
  font-size: 14px;
}

.mode-row {
  color: #0866c2;
  font-weight: 800;
  margin: 4px 0 12px;
}

.desktop-status {
  margin: 0 0 24px;
  color: #52616f;
  font-size: 12px;
}

.contacts-title {
  margin: 0 0 12px;
  font-size: 22px;
  color: #172330;
}

.quality-row {
  margin-top: 14px;
}

.muted {
  color: var(--muted);
}

.portal-dashboard {
  display: grid;
  gap: 18px;
}

.account-hero,
.signin-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 124, 128, 0.12), rgba(255, 255, 255, 0) 48%),
    #ffffff;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow);
}

.account-hero h2,
.signin-hero h2 {
  margin-bottom: 8px;
}

.account-hero p,
.signin-hero p {
  max-width: 680px;
  color: var(--muted);
  margin-bottom: 0;
}

.hero-actions,
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.metric-card,
.portal-panel,
.download-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 32px;
  line-height: 1;
}

.portal-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.portal-main-column {
  display: grid;
  gap: 18px;
}

.portal-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.device-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.device-row {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 110px 110px 140px;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}

.device-row:first-child {
  border-top: 0;
}

.device-row.header {
  min-height: 38px;
  background: #f3f1eb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

button.device-row:hover,
button.device-row.selected {
  background: #f7fbfb;
}

.device-row strong,
.device-row small {
  display: block;
}

.device-row small {
  color: var(--muted);
  margin-top: 2px;
}

.empty-row {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.dot.online {
  background: #1d9a68;
}

.dot.offline {
  background: #a9a197;
}

.state-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-chip.good {
  color: #116443;
  background: #e9f7ef;
  border-color: #bfe5ce;
}

.state-chip.quiet {
  color: #6d655e;
  background: #f3f1eb;
}

.detail-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 14px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.detail-list div:first-child {
  border-top: 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 10px;
}

.detail-list dt {
  color: var(--muted);
  background: #f3f1eb;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.session-list {
  display: grid;
  gap: 10px;
}

.group-list {
  display: grid;
  gap: 10px;
}

.group-row {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.group-row strong,
.group-row small {
  display: block;
}

.group-row small {
  color: var(--muted);
  margin-top: 2px;
}

.session-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 120px auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.session-card strong,
.session-card small {
  display: block;
}

.session-card small {
  color: var(--muted);
}

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.activity-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 4px;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.activity-item small {
  color: var(--muted);
  margin-top: 2px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.download-card {
  padding: 18px;
  display: grid;
  gap: 9px;
}

.download-card h3 {
  margin-bottom: 0;
}

.download-card strong {
  font-size: 13px;
}

.download-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.selected-plan {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(22, 124, 128, 0.18), var(--shadow);
}

.download-icon-box {
  width: 48px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--rail);
  font-size: 12px;
  font-weight: 900;
}

.checklist-grid,
.settings-grid,
.usage-grid {
  display: grid;
  gap: 10px;
}

.checklist-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.checklist-grid span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #f8f6f1;
}

.team-list {
  display: grid;
  gap: 10px;
}

.team-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 900;
}

.team-row small {
  display: block;
  color: var(--muted);
}

.usage-item {
  display: grid;
  gap: 8px;
}

.usage-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.usage-item span {
  color: var(--muted);
}

.usage-track {
  height: 10px;
  border-radius: 999px;
  background: #ebe7de;
  overflow: hidden;
}

.usage-track span {
  height: 100%;
  display: block;
  background: var(--accent);
}

.setting-row {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.setting-row input {
  width: 18px;
  min-height: 18px;
}

.signed-out-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 18px;
  align-items: stretch;
}

.signin-hero {
  min-height: 360px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
}

.mini-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  width: min(520px, 100%);
  margin-top: 18px;
}

.mini-feature-grid span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  padding: 10px;
  font-weight: 800;
}

.preview-panel {
  display: grid;
  place-items: center;
}

.portal-preview-window {
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.preview-bar {
  height: 34px;
  background: var(--rail);
}

.preview-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.preview-body span {
  height: 44px;
  border-radius: 7px;
  background: #ece8df;
}

.portal-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  background: var(--rail);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.portal-toast.error {
  background: var(--danger);
}

.wide-tree {
  max-width: 760px;
}

.session-tabs {
  padding: 0 22px 22px;
  display: grid;
  gap: 14px;
}

.remote-tab {
  overflow: hidden;
}

.remote-window {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 36px 38px minmax(0, 1fr);
  background: #111;
}

.remote-window-tabs {
  display: flex;
  align-items: stretch;
  background: #0872ce;
  color: #fff;
}

.remote-tab-button,
.remote-tab-plus {
  min-width: 220px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 0 14px;
  text-align: left;
}

.remote-tab-button.active {
  background: #fff;
  color: #172330;
}

.remote-tab-plus {
  min-width: 44px;
  text-align: center;
  font-size: 22px;
  background: transparent;
}

.remote-menubar {
  display: grid;
  grid-template-columns: repeat(4, auto) minmax(0, 1fr) repeat(2, auto);
  gap: 4px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d9dee5;
  padding: 0 8px;
}

.remote-menubar button {
  height: 30px;
  border: 0;
  background: transparent;
  color: #172330;
  padding: 0 8px;
}

.remote-menubar button:hover {
  background: #eef1f5;
}

.remote-window-stage {
  min-height: 0;
  display: grid;
}

.remote-tab-window {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
}

.remote-toolbar {
  min-height: 48px;
  background: var(--rail);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.remote-toolbar button,
.remote-toolbar select {
  min-height: 32px;
}

.remote-screen {
  min-height: 260px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(22, 124, 128, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(22, 124, 128, 0.12) 1px, transparent 1px),
    #e9efef;
  background-size: 28px 28px;
  color: var(--rail);
  text-align: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.remote-tab-window .remote-screen {
  min-height: 0;
  height: 100%;
}

.remote-video {
  width: 100%;
  height: min(68vh, 620px);
  min-height: 260px;
  object-fit: contain;
  background: #111;
}

.remote-tab-window .remote-video {
  height: 100%;
  min-height: 0;
}

.remote-placeholder {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 20px;
}

.remote-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 320px;
  background: var(--rail);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.remote-notice button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  border-radius: 6px;
}

.remote-window-error {
  color: #fff;
  align-self: center;
  justify-self: center;
  text-align: center;
}

.file-transfer {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.transfer-window {
  min-height: 100vh;
  background: #f7f8fa;
  display: grid;
  grid-template-rows: 88px 40px minmax(0, 1fr) 34px 96px;
  color: #172330;
}

.transfer-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 10px 22px;
  background: #fff;
  border-bottom: 1px solid #cfd6de;
}

.transfer-computer {
  display: flex;
  gap: 12px;
  align-items: center;
}

.transfer-computer strong span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #52616f;
}

.quiet-avatar,
.screen-avatar {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: #dfe5ec;
}

.screen-avatar {
  background: #1c8adb;
  box-shadow: inset 0 0 0 4px #75b5e8;
}

.transfer-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 5px 10px;
  background: #fff;
  border-bottom: 1px solid #cfd6de;
}

.transfer-paths div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 6px;
}

.transfer-paths button,
.transfer-actions button,
.transfer-queue button {
  border: 1px solid #cfd6de;
  background: #fff;
  border-radius: 3px;
}

.transfer-panes {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 10px;
}

.transfer-panes section {
  min-height: 0;
  background: #fff;
  border: 1px solid #aeb8c2;
  overflow: auto;
}

.transfer-table-head,
.transfer-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 130px 150px;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #e1e5ea;
  font-size: 13px;
}

.transfer-table-head {
  font-weight: 700;
  background: #f2f4f6;
}

.transfer-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
}

.transfer-queue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 10px;
}

.transfer-queue div {
  min-height: 70px;
  display: grid;
  place-items: center;
  color: #b8c0c8;
  font-weight: 800;
  background: #fff;
  border: 1px solid #cfd6de;
}

.file-pane {
  min-height: 150px;
  padding: 12px;
}

.file-pane + .file-pane {
  border-left: 1px solid var(--line);
}

.file-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
  color: var(--muted);
}

.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  width: min(440px, calc(100vw - 28px));
  box-shadow: var(--shadow);
}

.modal form {
  padding: 18px;
}

.modal menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .tree-panel {
    display: none;
  }

  .desktop-frame {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .client-titlebar,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .client-account,
  .connection-grid,
  .portal-layout-grid,
  .signed-out-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .download-grid,
  .checklist-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .topbar-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  .pcid-display strong,
  .password-display strong {
    font-size: 28px;
  }

  .workspace,
  .client-view {
    padding: 16px;
  }

  .file-transfer {
    grid-template-columns: 1fr;
  }

  .file-pane + .file-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .account-hero,
  .signin-hero,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .download-grid,
  .checklist-grid,
  .mini-feature-grid {
    grid-template-columns: 1fr;
  }

  .device-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .session-card {
    grid-template-columns: 1fr;
  }

  .group-row {
    align-items: stretch;
    flex-direction: column;
  }

  .device-row.header {
    display: none;
  }

  .detail-list div {
    grid-template-columns: 1fr;
  }
}

body[data-app="portal"] {
  --ss-bg: #eef1f4;
  --ss-ink: #17202a;
  --ss-muted: #627080;
  --ss-soft: #f8f9fb;
  --ss-panel: #ffffff;
  --ss-line: #d7dde4;
  --ss-dark: #2c3238;
  --ss-dark-2: #20262b;
  --ss-blue: #0872ce;
  --ss-blue-2: #075ba5;
  --ss-green: #17875b;
  --ss-red: #bf3d3d;
  --ss-shadow: 0 14px 32px rgba(18, 28, 38, 0.11);
  background: var(--ss-bg);
  color: var(--ss-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body[data-app="portal"] button,
body[data-app="portal"] input,
body[data-app="portal"] select {
  font: inherit;
}

.ss-auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 480px);
  gap: 34px;
  align-items: center;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(44, 50, 56, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(44, 50, 56, 0.04) 1px, transparent 1px),
    #eef1f4;
  background-size: 42px 42px;
}

.ss-auth-copy {
  max-width: 760px;
  display: grid;
  gap: 22px;
}

.ss-product-mark,
.ss-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ss-logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ss-dark);
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
  object-fit: cover;
}

.ss-product-mark strong,
.ss-sidebar-brand strong {
  font-size: 18px;
}

.ss-sidebar-brand small {
  display: block;
  color: #b6c1cc;
  margin-top: 2px;
}

.ss-auth-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(40px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.ss-auth-copy p {
  max-width: 650px;
  margin: 0;
  color: var(--ss-muted);
  font-size: 18px;
  line-height: 1.55;
}

.ss-auth-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  max-width: 710px;
}

.ss-auth-stats span {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--ss-line);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  color: var(--ss-muted);
}

.ss-auth-stats strong {
  color: var(--ss-ink);
}

.ss-login-card,
.ss-panel,
.ss-modal form {
  background: var(--ss-panel);
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  box-shadow: var(--ss-shadow);
}

.ss-login-card {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.ss-kicker,
.ss-panel-heading span {
  margin: 0 0 5px;
  color: var(--ss-blue-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ss-login-card h2,
.ss-dashboard-head h1,
.ss-device-hero h1,
.ss-web-session-bar h1 {
  margin: 0;
  letter-spacing: 0;
}

.ss-login-card p,
.ss-dashboard-head p,
.ss-device-title p,
.ss-download-card p,
.ss-muted {
  color: var(--ss-muted);
}

.ss-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef2f6;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  padding: 4px;
}

.ss-auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ss-muted);
  font-weight: 800;
}

.ss-auth-tabs button.active {
  color: var(--ss-ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(23, 32, 42, 0.08);
}

.ss-form {
  display: grid;
  gap: 12px;
}

.ss-form label {
  display: grid;
  gap: 6px;
}

.ss-form label span,
.ss-form-message {
  font-size: 12px;
  font-weight: 800;
  color: var(--ss-muted);
}

.ss-form input,
.ss-form select,
.ss-search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--ss-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ss-ink);
  padding: 9px 11px;
}

.ss-form input:focus,
.ss-form select:focus,
.ss-search:focus {
  outline: 2px solid rgba(8, 114, 206, 0.18);
  border-color: var(--ss-blue);
}

.ss-form-message {
  min-height: 18px;
  margin: 0;
}

.ss-form-message.error {
  color: var(--ss-red);
}

.ss-primary-button,
.ss-secondary-button,
.ss-danger-button,
.ss-link-button,
.ss-icon-button {
  min-height: 38px;
  border: 1px solid var(--ss-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ss-ink);
  padding: 0 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.ss-primary-button {
  color: #fff;
  border-color: var(--ss-blue);
  background: var(--ss-blue);
}

.ss-primary-button:hover {
  background: var(--ss-blue-2);
}

.ss-secondary-button:hover,
.ss-link-button:hover {
  border-color: var(--ss-blue);
  color: var(--ss-blue-2);
}

.ss-danger-button {
  color: var(--ss-red);
}

.ss-danger-button:hover {
  border-color: var(--ss-red);
}

.ss-portal-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  background: var(--ss-bg);
}

.ss-sidebar {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--ss-dark);
  color: #fff;
  border-right: 1px solid #1a2026;
}

.ss-sidebar-actions {
  display: grid;
  gap: 10px;
}

.ss-sidebar .ss-search {
  background: #1f252b;
  border-color: #3b444d;
  color: #fff;
}

.ss-sidebar .ss-search::placeholder {
  color: #94a0ad;
}

.ss-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ss-sidebar .ss-secondary-button {
  background: #383f46;
  color: #fff;
  border-color: #48515a;
}

.ss-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #cbd3dc;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ss-tree-header button {
  border: 0;
  background: transparent;
  color: #cbd3dc;
  font-size: 12px;
}

.ss-device-tree {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
}

.ss-tree-group {
  border: 1px solid #404951;
  border-radius: 8px;
  overflow: hidden;
}

.ss-tree-group-title {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: #363d44;
  color: #fff;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-weight: 900;
}

.ss-tree-group-title small {
  color: #b6c1cc;
}

.ss-tree-items {
  display: grid;
  background: #2f363d;
}

.ss-tree-device {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 4px 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  border-top: 1px solid #404951;
  background: transparent;
  color: #dce3ea;
  padding: 9px 11px;
  text-align: left;
  position: relative;
}

.ss-tree-device:hover,
.ss-tree-device.selected {
  background: #fff;
  color: var(--ss-ink);
}

.ss-tree-device strong,
.ss-tree-device small {
  display: block;
}

.ss-tree-device small {
  color: #9eaab6;
  margin-top: 2px;
}

.ss-tree-device.selected small,
.ss-tree-device:hover small {
  color: var(--ss-muted);
}

.ss-presence-rail {
  width: 4px;
  height: 34px;
  border-radius: 99px;
  background: var(--ss-red);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ss-tree-device.online .ss-presence-rail {
  background: var(--ss-green);
}

.ss-presence-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 999px;
  background: var(--ss-red);
  margin-right: 6px;
  box-shadow: 0 0 0 2px rgba(191, 61, 61, 0.16);
}

.ss-presence-dot.online {
  background: var(--ss-green);
  box-shadow: 0 0 0 2px rgba(23, 135, 91, 0.18);
}

.ss-tree-empty {
  padding: 12px;
  color: #aab5c0;
  font-size: 13px;
}

.ss-computer-icon {
  width: 18px;
  height: 14px;
  position: relative;
  display: inline-block;
  border: 2px solid currentColor;
  color: #9aa6b2;
}

.ss-computer-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -6px;
  height: 2px;
  background: currentColor;
}

.ss-computer-icon.online {
  color: var(--ss-blue);
}

.ss-computer-icon.large {
  width: 42px;
  height: 30px;
}

.ss-computer-icon.large::after {
  bottom: -9px;
  left: 12px;
  right: 12px;
}

.ss-console {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.ss-topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--ss-line);
}

.ss-topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.ss-topnav button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ss-muted);
  padding: 0 12px;
  font-weight: 800;
}

.ss-topnav button.active,
.ss-topnav button:hover {
  background: #fff;
  color: var(--ss-blue-2);
}

.ss-mobile-nav-only {
  display: none !important;
}

.ss-account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.ss-account-menu span {
  color: var(--ss-muted);
  font-size: 13px;
}

.ss-main-workspace {
  min-width: 0;
  padding: 20px;
  overflow: auto;
}

.ss-dashboard-head,
.ss-device-hero,
.ss-web-session-bar {
  background: #fff;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  box-shadow: var(--ss-shadow);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.ss-dashboard-head h1,
.ss-device-hero h1,
.ss-web-session-bar h1 {
  font-size: 28px;
  line-height: 1.18;
}

.ss-head-actions,
.ss-device-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ss-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ss-metric,
.ss-panel {
  background: #fff;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  box-shadow: var(--ss-shadow);
}

.ss-metric {
  padding: 16px;
  display: grid;
  gap: 5px;
}

.ss-metric span,
.ss-metric small {
  color: var(--ss-muted);
}

.ss-metric strong {
  font-size: 31px;
  line-height: 1;
}

.ss-dashboard-grid,
.ss-device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.ss-wide-panel {
  grid-column: 1 / -1;
}

.ss-panel {
  padding: 16px;
}

.ss-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ss-panel-heading h2,
.ss-download-card h2,
.ss-plan-card h2 {
  margin: 0;
  font-size: 20px;
}

.ss-table {
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  overflow: hidden;
}

.ss-table-row {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 110px 110px 140px;
  gap: 14px;
  align-items: center;
  border: 0;
  border-top: 1px solid var(--ss-line);
  background: #fff;
  color: var(--ss-ink);
  padding: 10px 12px;
  text-align: left;
}

.ss-table-row:first-child {
  border-top: 0;
}

.ss-table-row.header {
  min-height: 38px;
  background: #f3f5f7;
  color: var(--ss-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

button.ss-table-row:hover,
button.ss-table-row.selected {
  background: #f7fbff;
}

.ss-table-row strong,
.ss-table-row small {
  display: block;
}

.ss-table-row small,
.ss-session-row small,
.ss-team-row small {
  color: var(--ss-muted);
  margin-top: 2px;
}

.ss-status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--ss-red);
}

.ss-status-dot.online {
  background: var(--ss-green);
}

.ss-activity-list,
.ss-session-list,
.ss-team-list,
.ss-settings-grid {
  display: grid;
  gap: 10px;
}

.ss-activity-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.ss-activity-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ss-blue);
  margin-top: 5px;
}

.ss-activity-item strong,
.ss-activity-item small,
.ss-session-row strong,
.ss-session-row small {
  display: block;
}

.ss-session-row,
.ss-team-row,
.ss-setting-row {
  min-height: 54px;
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.ss-session-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.ss-session-row b,
.ss-state {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.ss-session-row b.good,
.ss-state.good {
  color: #116443;
  background: #e7f7ef;
}

.ss-session-row b.quiet,
.ss-state.quiet {
  color: #616a73;
  background: #eef1f4;
}

.ss-link-button {
  min-height: 30px;
  padding: 0 9px;
}

.ss-device-workspace {
  display: grid;
  gap: 16px;
}

.ss-device-title {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.ss-detail-list {
  display: grid;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
}

.ss-detail-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  border-top: 1px solid var(--ss-line);
}

.ss-detail-list div:first-child {
  border-top: 0;
}

.ss-detail-list dt,
.ss-detail-list dd {
  margin: 0;
  padding: 10px;
}

.ss-detail-list dt {
  background: #f3f5f7;
  color: var(--ss-muted);
  font-weight: 900;
}

.ss-connect-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.ss-web-session {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
}

.ss-web-session-bar {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.ss-web-session-bar span {
  color: var(--ss-muted);
}

.ss-web-viewer {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  background: #111820;
  border: 1px solid #111820;
  border-top: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  overflow: hidden;
}

#sessionVideo,
#sessionCanvas {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#sessionVideo {
  display: none;
  z-index: 1;
  background: #111820;
}

#sessionVideo.active {
  display: block;
}

#sessionCanvas {
  position: relative;
  z-index: 2;
}

#sessionCanvas.video-active {
  opacity: 0;
}

#sessionCanvas.actual-size,
#sessionVideo.actual-size {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

.ss-web-session:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #111820;
}

.ss-web-session:fullscreen .ss-web-viewer {
  min-height: 0;
  border-radius: 0;
}

.ss-mobile-computer-page {
  min-height: calc(100vh - 108px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.ss-mobile-computer-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  box-shadow: var(--ss-shadow);
}

.ss-mobile-computer-card dl {
  width: 100%;
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  overflow: hidden;
}

.ss-mobile-computer-card div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  border-top: 1px solid var(--ss-line);
}

.ss-mobile-computer-card div:first-child {
  border-top: 0;
}

.ss-mobile-computer-card dt,
.ss-mobile-computer-card dd {
  margin: 0;
  padding: 11px;
}

.ss-mobile-computer-card dt {
  background: #f3f5f7;
  color: var(--ss-muted);
  font-weight: 900;
}

.ss-mobile-computer-card dd {
  font-weight: 800;
}

.ss-mobile-computer-card .ss-primary-button {
  width: 100%;
  min-height: 44px;
}

.ss-viewer-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: #dbe4ed;
  padding: 24px;
}

.ss-viewer-placeholder h2 {
  margin-bottom: 8px;
}

.ss-download-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.ss-download-card {
  display: grid;
  gap: 9px;
}

.ss-download-card p,
.ss-plan-card p {
  margin: 0;
}

.ss-download-badge {
  width: 48px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ss-dark);
  color: #fff;
  font-weight: 900;
}

.ss-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.ss-check-grid span {
  border: 1px solid var(--ss-line);
  border-radius: 8px;
  padding: 10px;
  background: #f8f9fb;
  font-weight: 800;
}

.ss-team-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.ss-team-row > span:first-child {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ss-blue);
  color: #fff;
  font-weight: 900;
}

.ss-plan-card.selected {
  border-color: var(--ss-blue);
  box-shadow: inset 0 0 0 2px rgba(8, 114, 206, 0.16), var(--ss-shadow);
}

.ss-setting-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ss-setting-row input {
  width: 18px;
  min-height: 18px;
}

.ss-empty-line {
  padding: 16px;
  color: var(--ss-muted);
}

.ss-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.ss-modal::backdrop {
  background: rgba(15, 23, 31, 0.38);
}

.ss-modal form {
  width: min(520px, calc(100vw - 28px));
  padding: 18px;
}

.ss-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.ss-modal-header h2 {
  margin: 0;
}

.ss-modal menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  margin: 16px 0 0;
}

.ss-icon-button {
  min-height: 30px;
  padding: 0 9px;
}

.ss-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 360px;
  border-radius: 8px;
  background: var(--ss-dark);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--ss-shadow);
}

.ss-toast.error {
  background: var(--ss-red);
}

@media (max-width: 1120px) {
  .ss-auth-screen,
  .ss-dashboard-grid,
  .ss-device-grid {
    grid-template-columns: 1fr;
  }

  .ss-download-grid,
  .ss-metric-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .ss-portal-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .ss-console {
    order: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .ss-sidebar {
    order: 2;
    display: none;
    min-height: 0;
    border-right: 0;
    border-top: 1px solid #1a2026;
  }

  .ss-portal-app[data-view="computers"] .ss-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ss-portal-app[data-view="computers"] .ss-main-workspace {
    display: none;
  }

  .ss-sidebar-brand,
  .ss-tree-header {
    display: none;
  }

  .ss-device-tree {
    max-height: none;
    overflow: visible;
  }

  .ss-mobile-nav-only {
    display: inline-flex !important;
  }

  .ss-topbar {
    min-height: auto;
    padding: 8px;
  }

  .ss-topnav {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ss-topnav button {
    min-height: 36px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .ss-account-menu {
    display: none;
  }

  .ss-main-workspace {
    min-height: 0;
    flex: 1;
  }

  .ss-web-session {
    min-height: calc(100svh - 54px);
    grid-template-rows: minmax(0, 1fr);
  }

  .ss-web-session-bar {
    display: none;
  }

  .ss-web-viewer {
    min-height: calc(100svh - 54px);
    border: 0;
    border-radius: 0;
  }

  #sessionCanvas {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100svh - 54px);
  }

  .ss-mobile-computer-page {
    min-height: calc(100svh - 54px);
  }
}

@media (max-width: 700px) {
  .ss-auth-screen,
  .ss-main-workspace,
  .ss-sidebar {
    padding: 14px;
  }

  .ss-auth-copy h1 {
    font-size: 36px;
  }

  .ss-auth-stats,
  .ss-download-grid,
  .ss-metric-grid,
  .ss-check-grid {
    grid-template-columns: 1fr;
  }

  .ss-topbar,
  .ss-dashboard-head,
  .ss-device-hero,
  .ss-web-session-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .ss-table-row {
    grid-template-columns: 1fr;
  }
}
