:root {
  /* YJ Technology brand */
  --bg: #0A0F2E;       /* Deep Navy */
  --panel: #111840;
  --line: #1E2858;
  --text: #E5E7EB;     /* Light Gray */
  --muted: #8C93B5;
  --accent: #00C896;   /* Emerald Green — primary */
  --accent-2: #0066FF; /* Tech Blue — secondary */
  --on-accent: #0A0F2E;
  --ok: #00C896;
  --warn: #F0A63A;
  --danger: #EF5B5B;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
}

button, select, input { font: inherit; color: inherit; }

button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
button:active { transform: scale(.97); }

.muted { color: var(--muted); font-size: 13px; }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 340px; text-align: center; display: grid; gap: 12px; }
.login img { margin: 0 auto 4px; }
.login .get-app { color: var(--accent); text-decoration: none; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.login .brand { margin-top: 18px; color: var(--muted); letter-spacing: .2em; font-size: 11px; text-transform: uppercase; }
.login h1 { margin: 4px 0 0; font-size: 22px; }
.login p { margin: 0 0 8px; color: var(--muted); }
.login input { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: center; direction: ltr; }
.login button { background: var(--accent); color: var(--on-accent); border: 0; padding: 14px; font-weight: bold; }
.err { background: #2a1630; color: #ffb4b4; padding: 10px; border-radius: 10px; }

/* ── shell ── */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.who { flex: 1; display: grid; }
.who small { color: var(--muted); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: var(--danger); }
.ghost { background: none; border: 0; font-size: 20px; }

.tab { display: none; padding: 12px 16px 96px; }
.tab.active { display: block; }

.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom button { border: 0; border-radius: 0; background: none; display: grid; gap: 2px; font-size: 20px; padding: 8px 0; color: var(--muted); }
.bottom button span { font-size: 12px; }
.bottom button.active { color: var(--accent); }

/* ── screen ── */
.screen-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.pill { padding: 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stage {
  position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden; min-height: 180px; touch-action: pan-y;
  display: grid; place-items: center;
}
.stage.control { touch-action: none; outline: 2px solid var(--accent-2); }
.stage img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); }
.hint { margin-top: 6px; }

.keys { display: flex; gap: 8px; margin-top: 10px; }
.keys input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.keys.row { flex-wrap: wrap; }
.keys.row button { flex: 1 0 auto; font-size: 13px; padding: 8px 10px; direction: ltr; }

/* ── power ── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid.small { grid-template-columns: repeat(3, 1fr); }
.grid.small button { font-size: 22px; padding: 14px 0; }
.big { display: grid; gap: 6px; padding: 20px 8px; font-size: 28px; border-radius: var(--radius); }
.big span { font-size: 14px; }
.big.danger { border-color: #5a2a3d; background: #1d1430; }
.big.warn { border-color: #5a4630; background: #1b1a2e; }
.wide { width: 100%; margin-top: 10px; }
h3 { font-size: 14px; color: var(--muted); margin: 22px 0 10px; font-weight: normal; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; direction: ltr; text-align: right; }

/* ── files ── */
.files-bar { display: flex; gap: 8px; align-items: center; }
.crumb { flex: 1; overflow-x: auto; white-space: nowrap; font-size: 13px; color: var(--muted); padding: 6px 0; }
.files-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:last-child { border-bottom: 0; }
.list li:active { background: var(--panel); }
.list .ic { width: 24px; text-align: center; }
.list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.list .sz { color: var(--muted); font-size: 12px; direction: ltr; }
.xfer { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; font-size: 13px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 9;
  background: #18215A; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; text-align: center;
}
